jose Posted April 28, 2010 Share Posted April 28, 2010 Any suggestion indicating the solution of this problem? Appreciate, thanks <?php require_once('connectvars.php'); // Connect to the database $dbc = mysqli_connect(localhost, root, zam, entrepreneur); // Retrieve the user data from MySQL $query = "SELECT user_id, first_name, FROM user WHERE first_name IS NOT NULL ORDER DESC LIMIT 5"; $data = mysqli_query($dbc, $query); // Loop through the array of user data, formatting it as HTML echo '<h4>Latest members:</h4>'; echo '<table>'; while ($row = mysqli_fetch_array($data)) { if (isset($_SESSION['user_id'])) { echo '<td><a href="viewprofile.php?user_id=' . $row['user_id'] . '">' . $row['first_name'] . '</a></td></tr>'; } else { echo '<td>' . $row['first_name'] . '</td></tr>'; } } echo '</table>'; mysqli_close($dbc); ?> Link to comment https://forums.phpfreaks.com/topic/200001-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-g/ Share on other sites More sharing options...
trq Posted April 28, 2010 Share Posted April 28, 2010 Your query is failing and mysqli_query returning the bool false because you have an extra comma after first_name. Link to comment https://forums.phpfreaks.com/topic/200001-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-g/#findComment-1049725 Share on other sites More sharing options...
jose Posted April 28, 2010 Author Share Posted April 28, 2010 Thank you Thorpe, I removed the comma, but the message persists. Link to comment https://forums.phpfreaks.com/topic/200001-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-g/#findComment-1049840 Share on other sites More sharing options...
PFMaBiSmAd Posted April 28, 2010 Share Posted April 28, 2010 ORDER should be ORDER BY Link to comment https://forums.phpfreaks.com/topic/200001-warning-mysqli_fetch_array-expects-parameter-1-to-be-mysqli_result-boolean-g/#findComment-1049844 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.