jakubsnm Posted October 7, 2009 Share Posted October 7, 2009 I need a query to change all my customers account balances under $0 to $0 TABLE: users COLUMN to go over: Balance without affecting balances over $0 Appreciate any help guys n gals Link to comment https://forums.phpfreaks.com/topic/176893-solved-pls-need-help-to-change-all-table-column-cells-under-0-to-0/ Share on other sites More sharing options...
corbin Posted October 8, 2009 Share Posted October 8, 2009 Errr.... Pretty simple: UPDATE users SET balance = 0 WHERE balance < 0; Assuming that balance does not include $. If the balance column includes the $, it's not quite as simple. Link to comment https://forums.phpfreaks.com/topic/176893-solved-pls-need-help-to-change-all-table-column-cells-under-0-to-0/#findComment-932754 Share on other sites More sharing options...
jakubsnm Posted October 8, 2009 Author Share Posted October 8, 2009 Works like a charm... Ahhhh... this was not a homework question Link to comment https://forums.phpfreaks.com/topic/176893-solved-pls-need-help-to-change-all-table-column-cells-under-0-to-0/#findComment-932957 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.