ultraloveninja Posted April 29, 2011 Share Posted April 29, 2011 This is a new error for me. I tried looking through some older posts and so far nothing had fixed it and thus I am stumped. Any idea what could be throwing this error? <table> <?php //open DB connection include 'dbconn.php'; $sql = "select * tbl_test"; $result = mysql_query($sql,$conn); print $sql; while ($row = mysql_fetch_array($result)){ $status = $row['status']; $space = $row['spacename']; if ($status=="reserved") { echo <<<END <tr> <td style="background-color:#F00; color:#FFF;" align="center">Reserved</td> </tr> END; } else { echo <<<END <tr> <td align="center">$space</td> </tr> END; } } ?> </table> Quote Link to comment https://forums.phpfreaks.com/topic/235110-mysql_fetch_array-expects-parameter-1-to-be-resource-boolean-error/ Share on other sites More sharing options...
mikosiko Posted April 29, 2011 Share Posted April 29, 2011 the error is telling you that your query is wrong and didn't produce a valid result, hence mysql_fetch_array() failed too. $sql = "select * tbl_test"; and here the same topic was discussed today.. the suggestions there could help you to include improvements in your code http://www.phpfreaks.com/forums/index.php?topic=331080.0 Quote Link to comment https://forums.phpfreaks.com/topic/235110-mysql_fetch_array-expects-parameter-1-to-be-resource-boolean-error/#findComment-1208307 Share on other sites More sharing options...
ultraloveninja Posted April 29, 2011 Author Share Posted April 29, 2011 yeah, ummmmm... select * FROM tbl_test; fixed! Quote Link to comment https://forums.phpfreaks.com/topic/235110-mysql_fetch_array-expects-parameter-1-to-be-resource-boolean-error/#findComment-1208310 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.