The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
db error
I got this db error earlier tonight and was wondering if someone could please tell me what it means?
Quote:
Code:
if ($action=="SaveChanges") { $newsignature=censortext($signatureform); $DB_site->query("UPDATE user SET signature='".addslashes($newsignature)."' WHERE userid=$bbuserid"); Code:
if ($action=="SaveChanges") { $newsignature=censortext($signatureform); $DB_site->query("UPDATE user SET signature='".addslashes($newsignature)."' WHERE userid='$bbuserinfo[userid]'"); |
#2
|
||||
|
||||
$bbuserid is just defined in a cookie, and is never globalized in anyfunctions, $bbuserinfo['userid'] is defined nearly boardwide so you should always use this
|
#3
|
||||
|
||||
Was that what caused the db error then? The apostrophe in the name wouldn't have had anything to do with it, would it? I don't know why they used "$bbuserinfo['userid']" when calling info from the database and used "$bbuserid" to write it back. I guess I need to know if I fixed it by changing that variable or will I have problems on down the road somewhere with it?
|
#4
|
||||
|
||||
the userid, has no appostrophe in it
always use bbuserinfo[userid], i think that bbuserid was producing the error |
#5
|
||||
|
||||
Thank you, sir. That was what I needed to hear. What I don't get is when I was running that same file on v2.2.5, it worked fine and I never got an error with it.
|
#6
|
||||
|
||||
i think vb225 has globalized also bbuserid, not sure, but i could be that...
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|