plutomed Posted July 3, 2009 Share Posted July 3, 2009 An example: mysql_query("UPDATE table SET `col`='1' EXCEPT id='5'") Is there a way to update all values in a table except 1 row? Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/ Share on other sites More sharing options...
Adam Posted July 3, 2009 Share Posted July 3, 2009 where `id` != 5 Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/#findComment-868394 Share on other sites More sharing options...
plutomed Posted July 3, 2009 Author Share Posted July 3, 2009 <Ignore> Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/#findComment-868401 Share on other sites More sharing options...
Adam Posted July 3, 2009 Share Posted July 3, 2009 Was there an error? Edit: Didn't see you had modified post. Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/#findComment-868402 Share on other sites More sharing options...
plutomed Posted July 3, 2009 Author Share Posted July 3, 2009 Didn't work. where `id` != 5 Needed quotes round the 5, '5'. Gawd I am such an idiot not thinking of that fo myself though. Thanx alot. Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/#findComment-868403 Share on other sites More sharing options...
Adam Posted July 3, 2009 Share Posted July 3, 2009 Ah, I jumped to the conclusion your ID field was integer. Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/#findComment-868404 Share on other sites More sharing options...
plutomed Posted July 3, 2009 Author Share Posted July 3, 2009 It is. I tried it without but it didn't work. But worked with them. Link to comment https://forums.phpfreaks.com/topic/164675-solved-is-this-possible-mysql_query/#findComment-868405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.