Search the Community
Showing results for tags '#sql'.
-
Hey guys. I need help with the program. I get error Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\index.php on line 15 Here is my code: 1st file. <?php include_once 'includes/DuombazesInfo.php' ?> <!DOCTYPE html> <html> <head> <title></title> </head> <body> <?php $sql = "SELECT * FROM vartotojai"; $result = mysqli_query($con, $sql); $resultCheck = mysqli_num_rows($result); if ($resultCheck > 0) { while ($row = mysqli_fetch_assoc($result)) { echo $row['vartotojas_vardas']; } } ?> </body> </html> 2nd file. <?php $dbServername = "localhost"; $dbUsername = "root"; $dbPassword = ""; $dbName = "duombaze"; $con = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbPassword);