Jump to content
MakeWebGames

Call to a member function query() on a non-object - Error in my forum


juelpatwary
 Share

Recommended Posts

If i go to move or delete a topic in my forum ( DBS V2 ) it comes up this error

Call to a member function query() on a non-object in /home/beasther/public_html/forums.php on line 629
On line 629 is
$q=$db->query("SELECT * FROM forum_topics WHERE ft_id={$_GET['topic']}");

5 lines above 629

global $ir, $c, $userid, $h, $bbc;

if($ir['user_level'] < 2)

{

die("");

}

5 lines below 629

$topic=$db->fetch_row($q);

$q2=$db->query("SELECT * FROM forum_forums WHERE ff_id={$_POST['forum']}");

$forum=$db->fetch_row($q2);

$db->query("UPDATE forum_topics SET ft_forum_id={$_POST['forum']} WHERE ft_id={$_GET['topic']}");

$db->query("UPDATE forum_posts SET fp_forum_id={$_POST['forum']} WHERE fp_topic_id={$_GET['topic']}");

If needed.

Please help, Thanks

Link to comment
Share on other sites

Re: Call to a member function query() on a non-object - Error in my forum

Thanks. For me, adding $db fixed the deleting posts error.

When trying to delete the thread, I get

Fatal error: Call to a member function on a non-object in /home/virtual/site7/fst/var/www/html/forums.php on line 707

$r=$db->fetch_row($q);

which is at

$db->query("UPDATE forum_topics SET ft_locked=-ft_locked+1 WHERE ft_id={$_GET['topic']}");

$q=$db->query("SELECT * FROM forum_topics WHERE ft_id={$_GET['topic']}");

$r=$db->fetch_row($q);

print "{$r['ft_name']}'s lock status changed, if it was unlocked, it will now be locked, otherwise, it will be unlocked.";

if($r['ft_locked']==0) {

stafflog_add("Unlocked Topic {$r['ft_name']}");

Even though locking works just fine!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...