PDA

View Full Version : Complete db novice... Help Needed


andi02
09-28-2005, 08:50 AM
Hi Everyone

Help Needed Please.

Whenever I save changes in User Cp - Edit Options, I get the error below.
Can anyone tell what the error is and how can I correct the problem without altering the rest of the db?
Any ideas guy's?

Thanks - Andy :ermm:

Database error in vBulletin 3.0.9:

Invalid SQL:
UPDATE user SET
styleid = 0,
showvbcode = 2,
pmpopup = 0,
maxposts = -1,
daysprune = 0,
timezoneoffset = '0',
startofweek = 1,
languageid = 0,
threadedmode = 0,
autosubscribe = -1,
showdonor = ,
options = 2263
WHERE userid = 1

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '
options = 2263
WHERE userid = 1' at line 12

mysql error number: 1064

Script: profile.php

Necron
09-28-2005, 09:24 AM
showdonor = ,
that be it?

pyro.699
09-28-2005, 09:38 AM
YEs, im 99.99932% shure thats it, because its telling it to do somethign, but you havent set anyhitng for it to do ^^

andi02
09-28-2005, 09:51 AM
This is going a little bit above my head?? - Does this mean its a PHP error or a db error?

the script in the profile.php is

// Add user choice to show donor status
if ($bbuserinfo['showdonor'] == '1'){
$checked['showdonor'] == HTML_CHECKED;
}
// End user choice to show donor status

AND THEN LATER IN THE SCRIPT

$DB_site->query("
UPDATE " . TABLE_PREFIX . "user SET
" . $updatestyles . "
showvbcode = $showvbcode,
pmpopup = $pmpopup,
maxposts = $umaxposts,
daysprune = $prunedays,
timezoneoffset = '$timezoneoffset',
startofweek = $startofweek,
languageid = $languageid,
threadedmode = $threadedmode,
autosubscribe = $autosubscribe,
showdonor = $showdonor,
options = " . convert_array_to_bits($options, $_USEROPTIONS) . "
WHERE userid = $bbuserinfo[userid]
");



Thanks

Andy

Necron
09-28-2005, 10:12 AM
change
showdonor = $showdonor,

to
showdonor = '$showdonor',

?

andi02
09-28-2005, 10:27 AM
Well I took your kind advice but alas the problem continues only this time the error is slightly different. Take a look at the donor section now!

Invalid SQL:
UPDATE user SET
styleid = 0,
showvbcode = 2,
pmpopup = 0,
maxposts = -1,
daysprune = 0,
timezoneoffset = '0',
startofweek = 1,
languageid = 0,
threadedmode = 0,
autosubscribe = -1,
showdonor = $'showdonor',
options = 2263
WHERE userid = 1

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''showdonor',
options = 2263
WHERE userid = 1' at line 12

Best Regards
Andy

Necron
09-28-2005, 10:37 AM
but the ' before the $

showdonor = '$showdonor',

not
showdonor = $'showdonor',

andi02
09-28-2005, 10:44 AM
Yep my mistake....

Well I've just tried again it's working now.

FANTASTIC

Thanks Loads

Best Regards
Andy :banana: