carleihar Posted November 14, 2009 Share Posted November 14, 2009 I get this error: An error occurred in script '/home/content/e/q/u/equianadmin/html/htdocs/pages/my_barn.php' on line 21: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given for this line of code: $row = @mysqli_fetch_array ($r, MYSQLI_NUM); I've also gotten this same error for this line of code: if (mysqli_num_rows($r) == 1) { What am I doing wrong? Thanks so much! Quote Link to comment Share on other sites More sharing options...
Garethp Posted November 14, 2009 Share Posted November 14, 2009 Well show us what $r is. Man, how can you expect us to help you if you don't give us the basics of what we need. Basically, it wants $r = myqsli_query("Something"); but it's not Quote Link to comment Share on other sites More sharing options...
carleihar Posted November 14, 2009 Author Share Posted November 14, 2009 First time: $q = "SELECT COUNT(horse_name) FROM horses WHERE user_name = {$_SESSION['username']}"; $r = @mysqli_query ($dbc, $q); $row = @mysqli_fetch_array ($r, MYSQLI_NUM); Second time: $hn = $_GET['hn']; $q = "SELECT CONCAT('horse_name, 'user_name') AS info FROM horses WHERE horse_name = $hn"; $r = mysqli_query ($dbc, $q); if (mysqli_num_rows($r) == 1) { Quote Link to comment Share on other sites More sharing options...
mga_ka_php Posted November 14, 2009 Share Posted November 14, 2009 from $q = "SELECT CONCAT('horse_name, 'user_name') AS info FROM horses WHERE horse_name = $hn"; to $q = "SELECT CONCAT('horse_name, 'user_name') AS info FROM horses WHERE horse_name = '$hn'"; see the ' at $hn Quote Link to comment 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.