mysql
hockey_goalie31 asked:


I have a mysql database that receives the data from a php form that submits a unique user id, and 3 sports. I will likely be adding new fields (age etc) but the main thing I want to accomplish is if my users go through the form again (logged into to the same user id) and submit different information, how could I overwrite the old entry so I only have 1 record for the user?

hopefully this is possible one way or another !

Comments

? on 14 November, 2008 at 9:17 pm #

use update…

“UPDATE usertable SET userid = 1234 WHERE userid = 4567″

This will update the row where userid is equal to 4567 to a new user id of 1234 on the table named “usertable”.


jmorge on 14 November, 2008 at 11:16 pm #

use the “update” command.

the basic syntax of it is

UPDATE SET =, = WHERE =

remember to always use a Where clause otherwise it will update every row in your table…which is not what you want to happen


Post a Comment
Name:
Email:
Website:
Comments: