jlrough Posted July 3, 2012 Share Posted July 3, 2012 I got this error on the line on the while line (36) with fetch_assoc. I am seeing this error in firebug on the AJAX response. It looks like I am only getting the first row of the result. Mysql community 5.1, Thanks, Success... 127.0.0.1 via TCP/IP <br /> <b>Warning</b>: mysqli_result::fetch_assoc() [<a href='mysqli-result.fetch-assoc'>mysqli-result.fetch-assoc</a>]: Couldn't fetch mysqli_result in <b>/Library/WebServer/Documents/ajax/get_todosx2.php</b> on line <b>36</b><br /> array(1) { [0]=> array(3) { ["todo"]=> string(22) "What needs to be done?" ["date"]=> string(10) "0000-00-00" ["name"]=> string( "By whom?" } } $mysqli = new mysqli($dbhost,$dbuser, $dbpass, $dbname,$dbport); if ($mysqli->connect_error) { die('Connect Error (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error); } echo 'Success... ' . $mysqli->host_info . "\n"; $sql = 'SELECT todo,date,name FROM task WHERE todo > "" '; $result = $mysqli->query($sql); if ($result){ $arr_result = array(); while($row = $result->fetch_assoc())){ $arr_result[] = $row; }//end while }//end if Link to comment https://forums.phpfreaks.com/topic/265173-couldnt-fetch-mysqli_result/ Share on other sites More sharing options...
Pikachu2000 Posted July 3, 2012 Share Posted July 3, 2012 When posting code, enclose it within the forum's . . . BBCode tags. Link to comment https://forums.phpfreaks.com/topic/265173-couldnt-fetch-mysqli_result/#findComment-1358909 Share on other sites More sharing options...
mikosiko Posted July 3, 2012 Share Posted July 3, 2012 while($row = $result->fetch_assoc())){ to many closing parethesis Link to comment https://forums.phpfreaks.com/topic/265173-couldnt-fetch-mysqli_result/#findComment-1358924 Share on other sites More sharing options...
jlrough Posted July 3, 2012 Author Share Posted July 3, 2012 I removed the stray parenthesis and i still get the same error message on line 36. I even cleared the firefox cache to make sure. I also have the error message set and sent to the error log . I can read it in the firebug console. That is where I am getting the following message from. ini_set('error_reporting', E_ALL); error_log("get_todosx error",3,"/var/tmp/Janis-Rough.local.err"); Success... 127.0.0.1 via TCP/IP <br /> <b>Warning</b>: mysqli_result::fetch_assoc() [<a href='mysqli-result.fetch-assoc'>mysqli-result.fetch-assoc</a>]: Couldn't fetch mysqli_result in <b>/Library/WebServer/Documents/ajax/get_todosx2.php</b> on line <b>36</b><br /> array(1) { [0]=> array(3) { ["todo"]=> string(22) "What needs to be done?" ["date"]=> string(10) "0000-00-00" ["name"]=> string( "By whom?" } } Link to comment https://forums.phpfreaks.com/topic/265173-couldnt-fetch-mysqli_result/#findComment-1358936 Share on other sites More sharing options...
jlrough Posted July 3, 2012 Author Share Posted July 3, 2012 I apologize. That was it. The error is fixed. THANKS, Link to comment https://forums.phpfreaks.com/topic/265173-couldnt-fetch-mysqli_result/#findComment-1358947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.