The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
small...but deadly.
I'm trying to figure out why I keep getting an error message for this simple query, could anybody give me an answer why?
Code:
$person=$DB_site->query_first("SELECT userid,posts FROM user WHERE $idlog == userid LIMIT 1"); Code:
Parse error: parse error in c:\apache\htdocs\index.php on line 83 Velocd |
#2
|
||||
|
||||
Try:
$person=$DB_site->query_first("SELECT userid,posts FROM user WHERE userid='$idlog' LIMIT 1"); |
#3
|
||||
|
||||
logician is right, no == in SQL queries.
but shouldn't that produce an mysql error? parse errors are something different normally. when you applied logicians solution and it doesn' work also, pleas coppy some lines above line 83 perhaps there is an error and php shows the wrong line (which happends mostly if you forget an ' " } or something |
#4
|
||||
|
||||
yep nice catch by Xenon.. :glasses:
Your line was wrong but this does not produce parse error. If line 83 is this line you posted here, check one line above and see if it ends with ; or not. After correcting the parse error your still need to correct your SQL query.. |
#5
|
||||
|
||||
Ah, just brilliant. Thanks
|
#6
|
||||
|
||||
Another quick question:
The following code is for the member of the day hack, and I'm trying to apply alittle more features to it. Wouldn't the following code be acceptable to displayfield5, field6, and field7 of the member of the day? Code:
$newmember=$DB_site->query_first("SELECT userid,username FROM user WHERE userid<>$daybits[1] AND (usergroupid=5 OR usergroupid=6 OR usergroupid=7 OR usergroupid=2) ORDER BY RAND() LIMIT 1"); $newtemplate=$thisdate.'||vb||'.$newmember['userid'].'||vb||'.$newmember['username']; $DB_site->query("UPDATE template SET template='".addslashes($newtemplate)."' WHERE templatesetid=-2 AND title='memberoftheday'"); $memberoftheday['userid']=$newmember['userid']; $memberoftheday['username']=$newmember['username']; $newmember2=$DB_site->query_first("SELECT field5,field6,field7 FROM userfield LINE 85: WHERE userid='$memberoftheday['userid']' LIMIT 1"); $memberoftheday['interests']=$newmember2['field5']; $memberoftheday['anime']=$newmember2['field6']; $memberoftheday['quote']=$newmember2['field7']; Code:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\apache\htdocs\index.php on line 85 |
#7
|
||||
|
||||
PHP Code:
|
#8
|
||||
|
||||
Thanks again! That defiantly cleared my error, but the small hack still doesn't want to work, and I cant figure out for the life of me what the problem is..it seems totally logical.....
This code is located in my vbhome index file, and I'm displaying the member of the day on my home page, along with their interests, favorite anime, and personal quote. its just when using $memberoftheday[quote] in the template nothing appears.... Ps: and yes, they do have a quote |
#9
|
||||
|
||||
perhaps field7 isn't the qoute field
if it is, recheck your spellings |
#10
|
||||
|
||||
No, I have rechecked my spelling and to see if the fields are correct a million times, and that doesn't seem to be the problem (as much as I wish it were)
It must be in the code, but I can't figure out where........ :dead: |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|