reecieboy Posted April 9, 2006 Share Posted April 9, 2006 Whats wrong with the above?Problem with query: UPDATE users SET sessionid=27768e4a7b8a093671bf7c4f1e883ed9 WHERE userid=userYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'a7b8a093671bf7c4f1e883ed9 WHERE userid=user' at line 1 Link to comment https://forums.phpfreaks.com/topic/6948-q-update-users-set-sessionidsession_id-where-userid_postusername/ Share on other sites More sharing options...
kenrbnsn Posted April 9, 2006 Share Posted April 9, 2006 You need to surround any text with single quotes:[code]<?php$q = "UPDATE users SET sessionid='".session_id()."' WHERE userid='".$_POST['username'] . "'";?>[/code]Ken Link to comment https://forums.phpfreaks.com/topic/6948-q-update-users-set-sessionidsession_id-where-userid_postusername/#findComment-25231 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.