Strange error with PHP: mysql_fetch_array() expects parameter 1 to be resource, boolean given -
normally, kind of error shows when trying perform mysql_fetch_array query that's faulty, getting error despite query being performed (it's insert, can check new entrances in phpmyadmin).
for example, output this:
$query= mysql_query("insert `objects` (`idobjects`, `obj_type`, `obj_name`, `obj_cdate`, `availability`, `status`, `user_iduser`) values (null, '$type', 'el teste', '$final', 'public', 'active', '13')"); $insert_place = mysql_fetch_array($query, mysql_assoc); if (!$insert_place) { die('invalid query: ' . mysql_error()); is warning: mysql_fetch_array() expects parameter 1 resource, boolean given in c:\xampp\htdocs\neo4play\factualimport.php on line 22 invalid query:
with no error provided, , row still inserted database. clue might causing this?
you can't fetch insert query not returning rows. use mysql_fetch_array() select statement return array of data query. take out:
$insert_place = mysql_fetch_array($query, mysql_assoc); and replace:
if (!$insert_place) with:
if (!$query)
Comments
Post a Comment