drranch Posted August 30, 2006 Share Posted August 30, 2006 I would like to insert into my Mysql database information related to the logged in user....here is the code I created, but there are problems....("INSERT INTO cars (name, registered, registry_id, make, color, markings, mfg_date, purchase_price, purchase_date, sell_price, sell_date, addnotes) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) WHERE username='{$_SESSION[loginUsername]}'"Problems:[list][*]If I remove the WHERE statement data is inserted in the cars table, but its not tied to the logged in user ID and username[*]If I use the WHERE statment I get this message - You have an error in your SQL syntax[/list]Any thoughts/ and education would be great to get me over this hump :-\FIXED - ("INSERT INTO cars (username, name, registered, registry_id, make, color, markings, mfg_date, purchase_price, purchase_date, sell_price, sell_date, addnotes) VALUES ('{$_SESSION[loginUsername]}', %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" ;D Quote Link to comment Share on other sites More sharing options...
fenway Posted August 30, 2006 Share Posted August 30, 2006 So is this solved? Quote Link to comment Share on other sites More sharing options...
drranch Posted August 31, 2006 Author Share Posted August 31, 2006 Yes. Thank you for asking... That is why I put [fixed] in the summary and added the fix to the bottom of the post Quote Link to comment Share on other sites More sharing options...
fenway Posted August 31, 2006 Share Posted August 31, 2006 No problem.. I'm used to seeing "SOLVED". 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.