nightkarnation Posted September 28, 2010 Share Posted September 28, 2010 Hey Guys, A very noob question...Here it goes: I want to update the field user_id on my database table, there a lot of rows that the user_id is the same... "testID", I just want to update only ONCE. mysql_query("UPDATE `users` SET status = '$StatusCheck' WHERE user_id = 'testID'"); Right now it's updating ALL the rows that have the user_id "testID". I just want to update only one. Any ideas? Thanks in advance! Cheers! Link to comment https://forums.phpfreaks.com/topic/214566-update-only-one-row-where-user_id-testid-user_idtestid-in-a-lot-of-rows/ Share on other sites More sharing options...
Pikachu2000 Posted September 28, 2010 Share Posted September 28, 2010 The query string should end with LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/214566-update-only-one-row-where-user_id-testid-user_idtestid-in-a-lot-of-rows/#findComment-1116524 Share on other sites More sharing options...
nightkarnation Posted September 28, 2010 Author Share Posted September 28, 2010 Awesome, thanks Pikachu! Cheers mate! Link to comment https://forums.phpfreaks.com/topic/214566-update-only-one-row-where-user_id-testid-user_idtestid-in-a-lot-of-rows/#findComment-1116527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.