Hello on my website, I have a page which allows the users to update their information. I am not sure how to write out the MySQL Query after they click the update button, I keep getting an error with this one, does anyknow whats wrong with it? Is that how you do a UPDATE (stuffhere) SET (stuff) WHERE (stuffhere) VALUES (stuffhere), I know thats not what I have now, but it didnt work either way...
Here is my query...
PHP Code:
$result = mysql_query(UPDATE testtable SET (FirstName='Dillon', LastName='Test',Street='123 Mine St',Town='LA',Zip='12323',State='LA',Email='a@a.com',PhoneHome='111-1111',Attending='No') WHERE (inte='388', FirstName='Dillon', LastName='Test',Street='123 Mine St',Town='tPWN',Zip='12323',State='AL',Email='a@a.com',PhoneHome='111-1111',Attending='Yes'));
It just dosent do doing anything I tried running it via a php webpage, the code is below, and I tried manually typing it into my MySQL manager, and I got an error which said: Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
PHP Code:
//This tells to connect to the MySQL Database, via the provided information above
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
//The query is to insert data into the "Info" table
$query = "UPDATE users SET (FirstName='$firstName', LastName='$lastName',Street='$userStre',Town='$userTown',Zip='$userZip',State='$userState',Email='$userEmail',PhoneHome='$userPhone',Attending='$userAttending') WHERE (inte='$inte', FirstName='$firstNameold', LastName='$lastNameold',Street='$userStreold',Town='$userTownold',Zip='$userZipold',State='$userStateold',Email='$userEmailold',PhoneHome='$userPhoneold',Attending='$userAttendingold')";
$result=mysql_query($query);