Alright. I've been working on this all day with no results. I tried searching with no luck either.
I am using a form to update information in a row in the table. Basically the user enters in their Alumni ID (this is the primary key / auto_increment value) and the information that they want to change.
Here is the code I am trying to use:
$query = "UPDATE 'alumni' SET
'First_Name' = '$_POST[FName]',
'Last_Name' = '$_POST[LName]',
'Email' = '$_POST',
'Home_Street' = '$_POST[HAddress]',
'Home_City' = '$_POST[HCity]',
'Home_State' = '$_POST[HState]',
'Home_Zip' = '$_POST[HZip]',
'Home_Phone' = '$HomePhone',
'Cell_Phone' = '$CellPhone',
'Work_Name' = '$_POST[WName]',
'Work_Street' = '$_POST[WAddress]',
'Work_Street2' = '$_POST[WAddress2]',
'Work_City' = '$_POST[WCity]',
'Work_State' = '$_POST[WState]',
'Work_Zip' = '$_POST[WZip]',
'Work_Phone' = '$WorkPhone',
'Sector' = '$_POST[Sector]',
'Practice_Area' = '$_POST[Practice_Area]',
'Contact' = '$_POST[Contact]' WHERE 'ID' = $AlumniID LIMIT 1
";
$rs = mysql_query($query) or die("Something went awry");
When I run it, I keep getting the "Something went awry" message. I can't understand what's going on. I know for certain that the column rows and the values that are getting inputted are all correct (i.e. no typos). I think the problem is in the "WHERE 'ID' = $AlumniID" line, but I can't seem to fix it. ID is the name of the primary key column. Can anyone help me?
I am using a form to update information in a row in the table. Basically the user enters in their Alumni ID (this is the primary key / auto_increment value) and the information that they want to change.
Here is the code I am trying to use:
$query = "UPDATE 'alumni' SET
'First_Name' = '$_POST[FName]',
'Last_Name' = '$_POST[LName]',
'Email' = '$_POST',
'Home_Street' = '$_POST[HAddress]',
'Home_City' = '$_POST[HCity]',
'Home_State' = '$_POST[HState]',
'Home_Zip' = '$_POST[HZip]',
'Home_Phone' = '$HomePhone',
'Cell_Phone' = '$CellPhone',
'Work_Name' = '$_POST[WName]',
'Work_Street' = '$_POST[WAddress]',
'Work_Street2' = '$_POST[WAddress2]',
'Work_City' = '$_POST[WCity]',
'Work_State' = '$_POST[WState]',
'Work_Zip' = '$_POST[WZip]',
'Work_Phone' = '$WorkPhone',
'Sector' = '$_POST[Sector]',
'Practice_Area' = '$_POST[Practice_Area]',
'Contact' = '$_POST[Contact]' WHERE 'ID' = $AlumniID LIMIT 1
";
$rs = mysql_query($query) or die("Something went awry");
When I run it, I keep getting the "Something went awry" message. I can't understand what's going on. I know for certain that the column rows and the values that are getting inputted are all correct (i.e. no typos). I think the problem is in the "WHERE 'ID' = $AlumniID" line, but I can't seem to fix it. ID is the name of the primary key column. Can anyone help me?