edawg Posted June 13, 2007 Share Posted June 13, 2007 hi, how can I clear rows from a table field?. I have a table set up, and what I want to do is count some votes, but once a week I want to clear all the votes to have them return to zero, so that way I can count fresh results for the new week?. Quote Link to comment https://forums.phpfreaks.com/topic/55464-solved-how-can-i-do-this/ Share on other sites More sharing options...
Wildbug Posted June 13, 2007 Share Posted June 13, 2007 Either UPDATE vote_table SET vote_column=0 /* Reset a row */ or DELETE FROM vote_table /* Delete all rows; add a WHERE clause to delete some rows */ It depends on how your table/voting system is set up. Quote Link to comment https://forums.phpfreaks.com/topic/55464-solved-how-can-i-do-this/#findComment-274123 Share on other sites More sharing options...
edawg Posted June 13, 2007 Author Share Posted June 13, 2007 WILDBUG YOU ARE THE MAN!!!!!!!!!!!!!!!!!!!!. thanks a million mate!. Quote Link to comment https://forums.phpfreaks.com/topic/55464-solved-how-can-i-do-this/#findComment-274127 Share on other sites More sharing options...
fenway Posted June 17, 2007 Share Posted June 17, 2007 Either UPDATE vote_table SET vote_column=0 /* Reset a row */ or DELETE FROM vote_table /* Delete all rows; add a WHERE clause to delete some rows */ It depends on how your table/voting system is set up. TRUNCATE also works... and resets the auto_increment counter. Quote Link to comment https://forums.phpfreaks.com/topic/55464-solved-how-can-i-do-this/#findComment-276328 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.