dsaba Posted February 27, 2007 Share Posted February 27, 2007 i'm confused about all the commas, quotes, double quotes when it comes to php and mysql i've seen at least 2 different ways to query sql in php, each with its own system of quotes, and syntax i looked up update syntax for mysql version 4.1 in the mysql manual online, but it solely talks about only mysql syntax and NOT how it should be done in php so I look up mysql syntax in the php.net manual, guess what? it tells me to refer to mysql manual! maybe I didn't catch it somewhere, but someone please link me an obvious guide to php mysql syntax the different methods (more than one i know), so I won't be confused anymore and ask questions like this thank you! also php parse error is telling me that my sql syntax is wrong here? anyone spot whats wrong? thanks again this is the parse error: hereYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''userlastactive'='this is the date and time' WHERE `username`='P2MHunT.co.nr'' at line 2 thanks again this is the php code: $query3 = "UPDATE `userinfo` SET `userip`='$svideosubmitterip', `userlanguage`='$svideosubmitlang', `useremail`='$videosubmitteremail', `userwebsite`='$svideosubmitterwebsite', `userfilecount`='$userfilecount', 'userlastactive'='$svideodatetime' WHERE `username`='$svideosubmitter'"; Link to comment https://forums.phpfreaks.com/topic/40396-mysql-syntax-for-4118/ Share on other sites More sharing options...
Orio Posted February 27, 2007 Share Posted February 27, 2007 Try removing the back-sticks from the column names. I mean, make it this way: $query3 = "UPDATE `userinfo` SET userip='$svideosubmitterip', userlanguage='$svideosubmitlang', useremail='$videosubmitteremail', userwebsite='$svideosubmitterwebsite', userfilecount='$userfilecount', 'userlastactive'='$svideodatetime' WHERE username='$svideosubmitter'"; Orio. Link to comment https://forums.phpfreaks.com/topic/40396-mysql-syntax-for-4118/#findComment-195453 Share on other sites More sharing options...
dsaba Posted February 27, 2007 Author Share Posted February 27, 2007 i found it i put '' instead of `` on one of the update inserts but a link to official documentation for all this would still be helpful thank u Link to comment https://forums.phpfreaks.com/topic/40396-mysql-syntax-for-4118/#findComment-195455 Share on other sites More sharing options...
Orio Posted February 27, 2007 Share Posted February 27, 2007 I can't see anything about quotes in the manual, have a look yourself: http://dev.mysql.com/doc/refman/4.1/en/update.html Orio. Link to comment https://forums.phpfreaks.com/topic/40396-mysql-syntax-for-4118/#findComment-195463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.