Jump to content

mysql syntax for 4.1.18


dsaba

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.