Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   Another MySql question... (http://www.programmingforums.org/showthread.php?t=7293)

TCStyle Nov 30th, 2005 6:00 AM

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.

stevengs Nov 30th, 2005 6:04 AM

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.


All times are GMT -5. The time now is 1:05 PM.

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