rajeshkhare
-
Posts
2 -
Joined
-
Last visited
Posts posted by rajeshkhare
-
-
On 3/20/2019 at 9:01 PM, Larry said:
That means your SELECT query isn't working. You'll need to run it separately on the server to see what the results are (i.e., what the error is).
<?php
//reading the database
$conn=mysqli_connect ("localhost", "root", "");
if (!$conn) {
echo "server connction error";
}
$db_conn = mysqli_select_db($conn, "test2");
$sql = "select id, name, email, passwd from f_user";
$query = mysqli_query($conn, $sql);
?>
<table>
<tr>
<td><strong>username</strong></td>
<td><strong>email</strong></td>
<td><strong>Passwd</strong></td>
<td><strong>Action</strong></td>
</tr>
<?php
if (mysqli_num_rows($query)>=1){
while ($row=mysqli_fetch_assoc($query)){?>
<tr>
<td><?php echo $row['name'];?></td>
<td><?php echo $row['email'];?></td>
<td><?php echo $row['passwd'];?></td>
<td><a href="edit.php?id=<?php echo $row['id'];?>"> Edit</a> I <a href
="delete.php?id=<?php echo $row['id']; ?>">Delete</a></td>
</tr>
<?php
}}
?>
</table>
Mysqli_Num_Rows() Expects Parameter 1 To Be Mysqli_Result, Boolean Given Array
in Effortless E-Commerce with PHP and MySQL
Posted
Please help me I am also getting the warning on above quote as mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\Mypractice\Old practice file\edit.php.php on line 20