Add results from database in form address
Posted: 31 Mar 2021, 03:54
Hello Coursesweb
I have a problem to get results from the database into input type text form in the place name.
Hope you can help me out.
I have a problem to get results from the database into input type text form in the place name.
Code: Select all
name="id='. $row1['id']. '&limit1"
I hope to get this result in the browser-url
name="id=19&limit1=10"
But I getting this result in url
Backup-Limit.php?id%3D19%26limit1=10
Code: Select all
<?php
// connect to the "tests" database
$conn = new mysqli('127.0.0.1', 'course_chat', '123456', 'course_chat');
// check connection
if (mysqli_connect_errno()) {
exit('Connect failed: '. mysqli_connect_error());
}
// SELECT sql query
$sql = "SELECT * FROM `ajax_chat_title` ORDER BY `ajax_chat_title`.`id` DESC LIMIT 3";
// perform the query and store the result
$result = $conn->query($sql);
// if the $result contains at least one row
if ($result->num_rows > 0) {
// output data of each row from $result
while($row1 = $result->fetch_assoc()) {
echo '<div class="'. $row1['id']. ' selectt">
<div class="search-box">
<form id="tfnewsearch" autocomplete="off" method="get" action="//145.53.93.209/Molendijk/Member/Backup/Backup-Limit.php?" target="_top">
<input type="submit" target="offtopic1" value="search" class="tfbutton">
<input type="text" style="" id="fname" class="tftextinput" name="id='. $row1['id']. '&limit1" size="21" placeholder="Search Members..." maxlength="120" />
<br>
<div class="result"></div> </form>
</div>
<strong>'. $row1['text']. '</strong>
</div>' ;
}
}
else {
echo 'No-one added yet a @1';
}
$conn->close();
?></div>