SkyRanger Posted January 15, 2013 Share Posted January 15, 2013 I am having a row list problem I have it working for one select but not others. if ($resulta = $mysqli->query("SELECT * FROM users where userlevel='3' and valid='1' ")) { ---line 200 /* determine number of rows result set */ $row_cnta = $resulta->num_rows; printf("%d", $row_cnta); /* close result set */ $resulta->close(); } /* close connection */ $mysqli->close(); ---line 212 This is the error I am getting Warning: mysqli::query() [mysqli.query]: Couldn't fetch mysqli in /index.php on line 200 Warning: mysqli::close() [mysqli.close]: Couldn't fetch mysqli in /index.php on line 212 I am also going to have a resultb and $row_cntab for another count check. with userlevel = '4' The first one I have is result and $row_cnt and that one works fine. So it display Userlevel 2 = 3 Users Userlevel 3 = 5 Users Userlevel 4 = 0 Users Link to comment https://forums.phpfreaks.com/topic/273208-row-list-problem/ Share on other sites More sharing options...
Jessica Posted January 15, 2013 Share Posted January 15, 2013 You need to check for errors. See the link in my signature. Edit: Actually it sounds like you're not even connected to the database. Link to comment https://forums.phpfreaks.com/topic/273208-row-list-problem/#findComment-1405943 Share on other sites More sharing options...
SkyRanger Posted January 15, 2013 Author Share Posted January 15, 2013 Thank you Jessica, once you put your edit post in there I knew exactly what my problem was. I had a $mysqli->close(); before my $resulta ran. Link to comment https://forums.phpfreaks.com/topic/273208-row-list-problem/#findComment-1405947 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.