View Single Post
  #1 (permalink)  
Old 08-06-03, 03:49 AM
paulj000 paulj000 is offline
Bull in a china shop
 
Join Date: Jul 2003
Location: California, USA
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Just learning: how do I update information in table?

Hi I am just learning to use PHP with MySQL and I am having some difficulties. I have successfully made a php script insert a new row into my table. But how do I have a form only update information in the table without adding a new row?

I used INSERT already but that added a new row.

I have a row like this

Code:
INSERT INTO logins ( 'user' , 'pass' , 'directory' , 'co' , 'add1' , 'add2' , 'city' , 'state' , 'zip' , 'phone' , 'url' , 'email' )  
VALUES ( 'joe41', 'happy', 'jo', 'Big Company', '1314 College Blvd.', 'Suite #200', 'Sacramento', 'CA', '95661', '916.555.5583', 'www.website.com', 'joe41@website.com' );
But what if joe41 wants to change his email address and submits the form with all the other info the same. Instead of adding a new row how does it update only the email now? or email and url only?

Thanks for the help
Reply With Quote