Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 30th, 2005, 7:00 AM   #1
TCStyle
Programmer
 
Join Date: Jan 2005
Location: Albany, NY
Posts: 43
Rep Power: 0 TCStyle is on a distinguished road
Another MySql question...

Alright, so when my user signs up he inputs some information that gets stored into my table called user_needed. Only about 1/2 of the columns are filled up when they register, and there is another 1/2 that is left blank. Now once the user registers and the session is set, they can go to page edit_profile.php and fill in the extra information that is in my table (information that isn't important enough to make them fill out upon registering). I can't figure out how to insert that information into the same row as all the other information. I thought it would be something like:
$username = $_SESSION['username'];
mysql_query("INSERT INTO user_needed WHERE username='$username'
('location', 'gender', 'website_name') VALUES('$location', '$gender', '$website')") or die(mysql_error());

... needless to say it doesn't work.
TCStyle is offline   Reply With Quote
Old Nov 30th, 2005, 7:04 AM   #2
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Read up on SQL... INSERT does just what it is meant to... insert a tupel into a relation (row into a table). You want to try UPDATE.
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC