mikkiharu Posted July 25, 2021 Share Posted July 25, 2021 <!DOCTYPE html> <html> <head> <title>Registered Users</title> <link rel="stylesheet" href="includes/style.css" type="text/css" media="screen"/> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css"> </head> <body> <?php include('includes/header.html'); ?> <center> <table id="records"> <thead> <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> <th>Email</th> </tr>> </thead> <tbody> <?php require_once('mysqli_connect.php'); $query = "SELECT * FROM users"; $result = mysqli_query($dbc,$query); if(mysqli_num_rows($result) > 0) -------------------------------------------------Line 28 { while($row = mysqli_fetch_assoc($result)) {?> <tr> <td><?php echo $row["id"];?></td> <td><?php echo $row["First Name"];?></td> <td><?php echo $row["Last Name"];?></td> <td><?php echo $row["Email"];?></td> </tr> <?php } } mysqli_close($dbc); ?> </tbody> </table> </center> </body> <?php include('includes/footer.html');?> </html> Quote Link to comment https://forums.phpfreaks.com/topic/313430-fatal-error-uncaught-typeerror-mysqli_num_rows-argument-1-result-must-be-of-type-mysqli_resulton-line-28/ Share on other sites More sharing options...
Barand Posted July 25, 2021 Share Posted July 25, 2021 Your call to mysqli_query() failed and returned "false". Check mysqli_error to see why. Quote Link to comment https://forums.phpfreaks.com/topic/313430-fatal-error-uncaught-typeerror-mysqli_num_rows-argument-1-result-must-be-of-type-mysqli_resulton-line-28/#findComment-1588588 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.