MySQL Error 'must be boolean' -
this question has answer here:
the error keep getting is: warning: mysql_fetch_array() expects parameter 1 resource, boolean given in c:\xampp\htdocs\pd\admin\view_presidents.php on line 19
i have copied entire query here. can help? can't figure out why getting email.
thanks,
$bioid = $_get['bioid']; require_once('includes/mysql_connect.php'); $sql = 'select * presidents id='.$bioid; $result= mysql_query($sql); $row = mysql_fetch_array($result); // retrieve , print every record: echo '<div class="name">'; echo $row['prez_name']; echo '</div>'; echo '<div class="rank">'; echo $row['prez_rank']; echo '</div>'; echo '<div class="served">'; echo $row['prez_served']; echo '</div>'; echo '<hr />'; echo '<div class="content">'; echo $row['prez_content']; echo '</div>';
you not making check needed :
$bioid = $_get['bioid']; require_once('includes/mysql_connect.php'); $sql = 'select * presidents id='.$bioid; $result= mysql_query($sql); if (!$result) { // add check. die('invalid query: ' . mysql_error()); }
Comments
Post a Comment