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
https://forums.phpfreaks.com/topic/154519-solved-inserting-one-item-into-a-table/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.