Stromgren Posted February 9, 2012 Share Posted February 9, 2012 I'm running this PHP script: global $connection; $query = "SELECT titel, description, pris1, pris1_dur, pris2, pris2_dur, pris3, pris3_dur, pris4, pris4_dur, image, sub_subject_id FROM user WHERE user_id = '" . $_SESSION['user_id'] . "'"; $data = mysqli_query($connection, $query); $row = mysqli_fetch_array($data); And I'm getting this error returned: Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /volume1/web/...php on line 101 Line 101 is the mysqli_fetch_array line. Can anyone spot the error? I've tested the query in phpMyAdmin and it works fine. Thanks in advance Link to comment Share on other sites More sharing options...
justsomeguy Posted February 9, 2012 Share Posted February 9, 2012 There's an error with the query, use mysqli_error to get the error message if the query fails. $data = mysqli_query($connection, $query) or exit(mysqli_error($connection)); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.