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 Link to comment https://forums.phpfreaks.com/topic/19095-fixedneed-help-with-insert-syntax/ Share on other sites More sharing options...
fenway Posted August 30, 2006 Share Posted August 30, 2006 So is this solved? Link to comment https://forums.phpfreaks.com/topic/19095-fixedneed-help-with-insert-syntax/#findComment-82795 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 Link to comment https://forums.phpfreaks.com/topic/19095-fixedneed-help-with-insert-syntax/#findComment-83260 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". Link to comment https://forums.phpfreaks.com/topic/19095-fixedneed-help-with-insert-syntax/#findComment-83265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.