Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /kaboomlabs.com/index.php on line 24 This is the error I get. Line 24 is while ($row = mysqli_fetch_array($data)) { ... the database is filled with the correct info. So I'm lost upon why this is happening... Any ideas would be appreciated. All I can think of is the { is not suppose to be there. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Guitar Wars - High Scores</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <h2>Guitar Wars - High Scores</h2> <p>Welcome, Guitar Warrior, do you have what it takes to crack the high score list? If so, just <a href="addscore.php">add your own score</a>.</p> <hr /> <?php // Connect to the database $dbc = mysqli_connect('localhost', 'pawz_PDI', 'xxxxxx', 'pawz_PDI'); // Retrieve the score data from MySQL $query = "SELECT * FROM guitarwars"; $data = mysqli_query($dbc, $query); // Loop through the array of score data, formatting it as HTML echo '<table>'; while ($row = mysqli_fetch_array($data)) { // Display the score data echo '<tr><td class="scoreinfo">'; echo '<span class="score">' . $row['score'] . '</span><br />'; echo '<strong>Name:</strong> ' . $row['name'] . '<br />'; echo '<strong>Date:</strong> ' . $row['date'] . '</td></tr>'; } echo '</table>'; mysqli_close($dbc); ?> </body> </html> Code (markup):
add or die(mysqli_error()) to your mysqli_query, see if your query is ok first, maybe misspelled table name