Forum Moderators: coopster

Message Too Old, No Replies

Editing Data in a database, using PHP

         

Esqulax

2:28 pm on Feb 25, 2008 (gmt 0)

10+ Year Member



Hiya,
how can i edit data in an SQL database using PHP?
Everytime i search for EDIT all i get is information on how to edit the database itself.

f'rinstance i have customer details in the db, but oh no! she goes and gets married... and changes her address!

so, id need to extract the data (SELECT command) put it into HTML text boxes (fairly easy... i should think value=$row['name'])

Then change the details

and on submit, re-write to the database, replacing the existing data.(this is the bit im not sure of the commands for)
as my db is real small, i dont see the point of comparing to see if data has changed and if it has, write, if not, do nothing... i may aswell replace all.
Any help would be awesome!

whoisgregg

2:37 pm on Feb 25, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Everytime i search for EDIT

Ahh, the command you are looking for is called UPDATE [dev.mysql.com]. :)

Esqulax

2:47 pm on Feb 25, 2008 (gmt 0)

10+ Year Member



Aha!
Merci beaucoup mon amis!