Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 05-05-2006, 10:58 PM Syntax error
VToria's Avatar
Extreme Talker

Posts: 151
Name: Viki
Location: West Yorkshire
Trades: 0
I'm not sure if this should go in the PHP or mysql section, so apologies if this is in the wrong place.

Can anyone help me hunt down the syntax error in the following bit of code:

PHP Code:
$sql "UPDATE " USERS_TABLE "
                SET " 
$username_sql $passwd_sql "user_email = '" str_replace("\'""''"$email) ."', user_icq = '" str_replace("\'""''"$icq) . "', user_website = '" str_replace("\'""''"$website) . "', user_occ = '" str_replace("\'""''"$occupation) . "', user_from = '" str_replace("\'""''"$location) . "', user_interests = '" str_replace("\'""''"$interests) . "', user_birthday = '$birthday', user_next_birthday_greeting = '$next_birthday_greeting', user_sig = '" str_replace("\'""''"$signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" str_replace("\'""''"str_replace(' ''+'$aim)) . "', user_yim = '" str_replace("\'""''"$yim) . "', user_msnm = '" str_replace("\'""''"$msn) . "', '" "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" str_replace("\'""''"$user_dateformat) . "', user_lang = '" str_replace("\'""''"$user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" str_replace("\'""''"$user_actkey) . "'" $avatar_sql ", user_country = '" str_replace("\'""''"$user_country) . "' 
__________________

Please login or register to view this content. Registration is FREE
- Reality TV videos, news and opinions.


Please login or register to view this content. Registration is FREE
- Bargains from a dedicated UK bargain hunter.
VToria is offline
Reply With Quote
View Public Profile Visit VToria's homepage!
 
 
Register now for full access!
Old 05-06-2006, 03:06 AM Re: Syntax error
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
What is the resulting query, after substituting all variables?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-06-2006, 10:48 AM Re: Syntax error
VToria's Avatar
Extreme Talker

Posts: 151
Name: Viki
Location: West Yorkshire
Trades: 0
I don't think I quite understand that question heh

I should have been clearer in my question, so further info....the problem I am having is with my phpBB forum, users cannot edit their profiles...if they try they get an error message similar to the following.

Quote:
Could not update users table

DEBUG MODE

SQL Error : 1064 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 ''', user_attachsig = 1, user_allowsmile = 1, user_allowhtml = 1, user_allowbbcod' at line 2

UPDATE phpbb_users SET user_email = 'georgefierce@hotmail.com', user_icq = '', user_website = 'http://georgie.wildmoonflower.com', user_occ = 'playing guitar', user_from = 'in your imagination...', user_interests = 'music, html, website design, music, punk rock, music, music, MUSIC!', user_birthday = '7759', user_next_birthday_greeting = '2007', user_sig = '[img:1813a03481]http://thesmilies.com/smilies/edible/lemon.gif[/img:1813a03481][img:1813a03481]http://tinypic.com/taoqb6.jpg[/img:1813a03481] nyum nyum nyum moon over marin [img:1813a03481]http://www.swayforum.com/other/collapsechamp.gif[/img:1813a03481] [img:1813a03481]http://i1.tinypic.com/v7cjzb.jpg[/img:1813a03481]', user_sig_bbcode_uid = '1813a03481', user_viewemail = 1, user_aim = 'fishyrockstar', user_yim = '', user_msnm = '', '', user_attachsig = 1, user_allowsmile = 1, user_allowhtml = 1, user_allowbbcode = 1, user_allow_viewonline = 1, user_notify = 0, user_notify_pm = 1, user_popup_pm = 1, user_timezone = -8, user_dateformat = 'D M d, Y g:i a', user_lang = 'english', user_style = 36, user_active = 1, user_actkey = '', user_avatar = 'http://i2.tinypic.com/xawikx.jpg', user_avatar_type = 2, user_country = 'usa' WHERE user_id = 62

Line : 602
File : usercp_register.php
I found the bit of code in usercp_register.php where I think the error is (the code I posted above) but I can't work out quite what the problem is, though I expect it to be somwhere around either the 'birthday' part or the 'country' part as those were to do with hacks we added.
__________________

Please login or register to view this content. Registration is FREE
- Reality TV videos, news and opinions.


Please login or register to view this content. Registration is FREE
- Bargains from a dedicated UK bargain hunter.

Last edited by VToria; 05-06-2006 at 10:50 AM..
VToria is offline
Reply With Quote
View Public Profile Visit VToria's homepage!
 
Old 05-06-2006, 11:27 AM Re: Syntax error
Minaki's Avatar
Defies a Status

Posts: 1,626
Location: Guildford, UK
Trades: 0
In the SQL, here's your problem:
Code:
user_msnm = '', '', user_attachsig = 1,
In the PHP that's:
Code:
user_msnm = '" . str_replace("\'", "''", $msn) . "', '" . "', user_attachsig = 


Basically it doesn't know what to do with the code that I've highlighted in red. It's generating a single pair of quotes without anything else to tell it what to do with them. I'm guessing that it should either be somefieldname = '' or just not be there at all.
__________________
Minaki Serinde MCP
"Wow, Linux is nearly on-par with Windows ME!"

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Minaki is offline
Reply With Quote
View Public Profile Visit Minaki's homepage!
 
Old 05-06-2006, 11:41 AM Re: Syntax error
VToria's Avatar
Extreme Talker

Posts: 151
Name: Viki
Location: West Yorkshire
Trades: 0
SUPERSTAR! Thanks so much, that has got it
__________________

Please login or register to view this content. Registration is FREE
- Reality TV videos, news and opinions.


Please login or register to view this content. Registration is FREE
- Bargains from a dedicated UK bargain hunter.
VToria is offline
Reply With Quote
View Public Profile Visit VToria's homepage!
 
Reply     « Reply to Syntax error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63748 seconds with 12 queries