Jolten
07-26-2004, 08:19 AM
I've got a table in my database named usrcredit.
This table has two fields, usrname and curcredit
The usrname field matches the usernames of all forum members I've given or awarded "credits" to. The curcredit field indicates their current amount of credits.
I'm trying to call this value on a page so that it can be included in Vbulletin pages and I'm hitting a snag somewhere in my query.
here's the query:
$DB_site->query("SELECT curcredit as curcredit FROM usrcredit WHERE usrname=$bbuserinfo[username]");
$credit = $bbuserinfo[curcredit];
it's generating this error:
Fatal error: Call to a member function on a non-object in /home/www/domainname/bb/test.php on line 8
if I change the query to:
$DB_site->query("SELECT curcredit as curcredit FROM usrcredit WHERE usrname=$bbuserinfo['username']");
$credit = $bbuserinfo[curcredit];
it generates this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/www/domainname/bb/test.php on line 8
Line 8 is the query.
Any help would be GREATLY appreciated.
Thanks.
This table has two fields, usrname and curcredit
The usrname field matches the usernames of all forum members I've given or awarded "credits" to. The curcredit field indicates their current amount of credits.
I'm trying to call this value on a page so that it can be included in Vbulletin pages and I'm hitting a snag somewhere in my query.
here's the query:
$DB_site->query("SELECT curcredit as curcredit FROM usrcredit WHERE usrname=$bbuserinfo[username]");
$credit = $bbuserinfo[curcredit];
it's generating this error:
Fatal error: Call to a member function on a non-object in /home/www/domainname/bb/test.php on line 8
if I change the query to:
$DB_site->query("SELECT curcredit as curcredit FROM usrcredit WHERE usrname=$bbuserinfo['username']");
$credit = $bbuserinfo[curcredit];
it generates this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/www/domainname/bb/test.php on line 8
Line 8 is the query.
Any help would be GREATLY appreciated.
Thanks.