zackcez Posted July 23, 2008 Share Posted July 23, 2008 Well, here's my code from line 43+: $getRankQuery = $db->query_read("SELECT * FROM user ORDER BY $end DESC"); while ($rankData = $db->fetch_array($getRankQuery)) { $endRank[$rankData['username']] = $rank++; } $db->free_result($getRankQuery); unset($rankData); And the error: Fatal error: Call to a member function on a non-object in C:\Inetpub\vhosts\MYSITE\httpdocs\modules\test.php on line 43 Link to comment https://forums.phpfreaks.com/topic/116116-mysql-fetch-array/ Share on other sites More sharing options...
.josh Posted July 23, 2008 Share Posted July 23, 2008 $db is not being instantiated. Where do you instantiate it? Link to comment https://forums.phpfreaks.com/topic/116116-mysql-fetch-array/#findComment-597111 Share on other sites More sharing options...
zackcez Posted July 23, 2008 Author Share Posted July 23, 2008 It's in the global.php file, this is a vbulletin module. Link to comment https://forums.phpfreaks.com/topic/116116-mysql-fetch-array/#findComment-597310 Share on other sites More sharing options...
JasonLewis Posted July 23, 2008 Share Posted July 23, 2008 Make sure that if this is in a function that you are calling this: global $db; Also make sure that $db is initiated. Link to comment https://forums.phpfreaks.com/topic/116116-mysql-fetch-array/#findComment-597314 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.