Reset Everything in SQL
Posted: Mon Aug 14, 2006 4:52 am
I have a table
After 24 hour I want to reset all hits_in and hits_out to 0. Is this possible with 1 or 2 SQL Commands or do i have to update every entry 1 at a time?
Code: Select all
mysql_query("CREATE TABLE Sites(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), hits_in INT(6) NOT NULL, hits_out INT(6) NOT NULL, total_in INT(7) NOT NULL, total_out INT(7) NOT NULL, site_name VARCHAR(200), site_url VARCHAR(200), banner_url VARCHAR(200), rating INT(4) NOT NULL, votes INT(4) NOT NULL, approved VARCHAR(1) NOT NULL, approved_by INT(6) NOT NULL, approved_message VARCHAR(250), username VARCHAR(30), comments INT(4) NOT NULL, description BLOB)")or die("Create table Error: ".mysql_error());After 24 hour I want to reset all hits_in and hits_out to 0. Is this possible with 1 or 2 SQL Commands or do i have to update every entry 1 at a time?