Quote:
Originally Posted by wahooka
thanks for the great tutorial.
i'm trying to use the db on a non-vb page...
this is my call which is causing the error:
PHP Code:
$post_id = $vbulletin->$db->query_first("SELECT postid FROM vb_post WHERE threadid = $threadid AND parentid = 0");
i am getting the error:
Code:
Fatal error: Call to a member function on a non-object in functions.php on line 179
any ideas on how to fix this?
|
make sure to include global, this will start the database connection and gives you the ability to use the classes. otherwise you need to do it using your database functions, ex: mysql_query instead of that. For mysql there is no query_first type if function. then use $row = mysql_fetch_array( $result );
when you query you can just do LIMIT 1 if you to. Either way it should work ok.
great tut, i never even thought about different database issues. Im working on a script myself and used the database escape function instead of vbs, im gonna change that.