Asperon Posted August 28, 2007 Share Posted August 28, 2007 so if I want to to do an insert query on a specific already created row, would the syntax be like this? mysql_query = "INSERT INTO coupons(paid,location) VALUES('0','$location') WHERE couponID='$couponID'"; thus paid and location information is inserted in to the coupons table with the rows that have $couponID as a their couponID right? or is there a different way that you are supposed to do it? Quote Link to comment Share on other sites More sharing options...
Asperon Posted August 28, 2007 Author Share Posted August 28, 2007 I wasn't getting any answers in the mysql forum so I came here, but I guess its busy today at phpfreaks.. Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 No, you do an UPDATE, not an INSERT. Quote Link to comment Share on other sites More sharing options...
Asperon Posted August 28, 2007 Author Share Posted August 28, 2007 I thought there was something else other than insert but I couldn't seem to find it, thank you Quote Link to comment Share on other sites More sharing options...
Asperon Posted August 28, 2007 Author Share Posted August 28, 2007 so would it be $query_add = "UPDATE coupons SET location='$location' WHERE couponID='$couponID'"; ?? Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 Yep. Quote Link to comment Share on other sites More sharing options...
Asperon Posted August 28, 2007 Author Share Posted August 28, 2007 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.