zartzar Posted July 15, 2010 Share Posted July 15, 2010 It wont update the database $query='UPDATE users SET name='.$_POST['username'].', location='.$_POST['location'].', email='.$_POST['email'].', password='.$_POST['password'].' WHERE userid='.$_SESSION['user'].' '; Quote Link to comment https://forums.phpfreaks.com/topic/207835-why-wont-this-update-query-work/ Share on other sites More sharing options...
bh Posted July 15, 2010 Share Posted July 15, 2010 Whats the error message? Anyway you should set strings into quotes: $query='UPDATE users SET name=\''.$_POST['username'].'\', ... Quote Link to comment https://forums.phpfreaks.com/topic/207835-why-wont-this-update-query-work/#findComment-1086498 Share on other sites More sharing options...
fenway Posted July 15, 2010 Share Posted July 15, 2010 It wont update the database $query='UPDATE users SET name='.$_POST['username'].', location='.$_POST['location'].', email='.$_POST['email'].', password='.$_POST['password'].' WHERE userid='.$_SESSION['user'].' '; Next time, read the rules about posting questions on this forum. Quote Link to comment https://forums.phpfreaks.com/topic/207835-why-wont-this-update-query-work/#findComment-1086676 Share on other sites More sharing options...
awjudd Posted July 16, 2010 Share Posted July 16, 2010 I believe that the error you are getting caused by the exact thing that bh was saying ... your strings aren't in quotes, so it looks in the database for those fields and when it can't find a field called 'bobo' (assuming $_POST [ 'username' ] = 'bobo' ) then it'll error. ~juddster Quote Link to comment https://forums.phpfreaks.com/topic/207835-why-wont-this-update-query-work/#findComment-1087003 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.