Current location: Hot Scripts Forums » Programming Languages » PHP » Just learning: how do I update information in table?


Just learning: how do I update information in table?

Reply
  #1 (permalink)  
Old 08-06-03, 04: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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-06-03, 07:04 PM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Location: Michigan
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
hi,

well its like this

UPDATE logins SET url='me.com' , email='madmin@me.com';

ez as that
__________________
Elite Bulletin Board
http://elite-board.us
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-06-03, 08:54 PM
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
That does look easy, thanks!

I'll give it a shot now.

- Paul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-07-03, 11:49 AM
darkcarnival's Avatar
darkcarnival darkcarnival is offline
PHP/MySQL coder
 
Join Date: Jun 2003
Location: Michigan
Posts: 939
Thanks: 0
Thanked 0 Times in 0 Posts
np
__________________
Elite Bulletin Board
http://elite-board.us
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Validator ctrl in table cell : Strange behaviour sunny_doncaster ASP.NET 6 07-31-08 10:43 AM
moving data from table to table ..please help! geneane ASP 2 09-22-03 08:02 PM
type mismatch and update loop - HELP! seala ASP 1 09-22-03 06:27 PM
Help Transfering information praeclarus PHP 1 07-24-03 07:03 PM
What can I use to update excel sheet on the fly using a browser? mysticwar PHP 1 06-17-03 02:23 AM


All times are GMT -5. The time now is 01:34 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.