Jump to content

[SOLVED] Inserting one item into a table


TGWSE_GY

Recommended Posts

Hi Guys,

 

Okay I have a table `basic_profile` and it has 12 columns (CustID, Headline, Country, ZipCode, State, Gender, Birthdate, Sexuality, InterestedIn, RelationshipStatus, HIVStatus, Ethnicity). Until the user fills in their profile the only thing that is in the table is the CustID, what I am wanting to do is an INSERT statement WHERE CustID = "$varCustID" and skipping CustID in the table and writing to the remaining fields in that record. How would I achieve this what I have right now is

	mysql_query("INSERT INTO profile_basic WHERE CustID = '$varCustID' ( Headline,Country,ZipCode,State,Gender,Birthdate,Sexuality,InterestedIn,RelationshipStatus,HIVStatus,Ethnicity )
										VALUE
									   ('$varHeadline', '$varCountry', '$varZipCode', '$varState', '$varGender', '$varBirthdate', '$varSexuality', '$varInterestedIn', '$varRelationshipStatus', '$varHIVStatus', '$varEthnicity')");

But obviously its not working. I have tested the $varCustID and it does echo the correct value. Any help would be most appreciated, thanks guys.

 

;D ??? ;D

Link to comment
Share on other sites

mysql_query("UPDATE profile_basic SET Headline=$varHeadline, Country=$varCountry, ZipCode=$varZipCode, State=$varState, Gender=$varGender, Birthdate=$varBirthdate, Sexuality=$varSexuality, InterestedIn=$varInterestedIn, RelationshipStatus=$varRelationshipStatus, HIVStatus=$varHIVStatus, Ethnicity=$varEthnicity WHERE CustID='$varCustID'")

would that be correct?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.