PDA

View Full Version : drrrrrr


AN-net
04-24-2004, 08:21 PM
error:

Call to a member function on a non-object in /home/anima22/public_html/testvb/journal.php on line 25


code:

23: function journalist_check($jid,$checkid)
24: {
25: $check= $DB_site->query_first("SELECT jouranlist_id FROM ".TABLE_PREFIX."journals WHERE journal_id='".$jid."'");
26: if($check['journalist_id']!=$checkid)
27: {
28: return "false";
29: }
30: else
31: {
32: return "true";
33: }
34: }

Velocd
04-24-2004, 08:29 PM
Functions can only access variables declared within their scope, or passed by parameter.

Unless, you use the global keyword.


function journalist_check($jid,$checkid)
{
global $DB_site; // $bbuserinfo, $vboptions, etc.


http://www.php.net/language.variables.scope