vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Complete db novice... Help Needed (https://vborg.vbsupport.ru/showthread.php?t=97051)

andi02 09-28-2005 08:50 AM

Complete db novice... Help Needed
 
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

Quote:

Originally Posted by andi02
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:


All times are GMT. The time now is 04:19 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00933 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete