Click here to Skip to main content
15,992,983 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
include("dbinfo.inc.php");
$conn = mysqli_connect($serv, $username, $password,$database)or die("cannot connect");
mysqli_select_db($conn,$database) or die( "Unable to select database");



<?
while ($i < $num) {
$cname=mysqli_result($result,$i,"NAME");
$cid=mysqli_result($result,$i,"ID");
echo "<option value=\"" . $cid . "\">" . $cname . "</option>";
$i++;
}
?>
</select>
<select name="id2">

<?
$i=0;
while ($i < $num) {
$cname=mysqli_result($result,$i,"NAME");
$cid=mysqli_result($result,$i,"ID");
echo "<option value=\"" . $cid . "\">" . $cname . "</option>";
$i++;
}
mysqli_close();
?>
</select>
<input type="submit" value="Submit" /></form><br>



Could you please tell me what do i need to change here in order to see my content properly ? Thank you.

What I have tried:

I have tried all versions of php
Posted
Updated 30-Mar-21 0:03am

How about you use this

$row = mysqli_fetch_array($pages_query);
$pages = ceil($row[0] / $per_page);
 
Share this answer
 
See the notes at PHP: mysqli_result - Manual[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900