Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
jumus
Hangin' Around



Joined: Jul 15, 2008
Posts: 30

PostPosted: Sat Jan 05, 2013 1:51 am Reply with quote

I have my theme I used with rn2.02, however when I try to use with my newly installed rn2.5 it is blank only the bg color.
When showing the error, it is Fatal error:
Call to a member function sql_query() on a non-object in /home/***/public_html/new/themes/Juma/theme.php on line 60

When I check theme.php on that line, I have
$toplist = $db->sql_query("select topicid, topictext from ".$prefix."_topics order by topictext");
while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {

What did I do wrong?
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Sat Jan 05, 2013 9:34 am Reply with quote

Do you have added $db and $prefix as global?

Code:
function example() {

   global $db, $prefix;
   $toplist = $db->sql_query('SELECT `topicid`, `topictext` FROM `' . $prefix . '_topics` ORDER BY `topictext`');
   while(list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
      // your code
   }
}

_________________
Github: RavenNuke 
View user's profile Send private message
jumus







PostPosted: Sun Jan 06, 2013 3:45 am Reply with quote

Thank you so much Neralex.
Your suggestion works.
Thanks
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©