Jump to content


Photo

Reset a whole row..


  • Please log in to reply
2 replies to this topic

#1 Chevy

Chevy
  • Members
  • PipPipPip
  • Advanced Member
  • 163 posts

Posted 03 September 2006 - 12:35 PM

I want to reset a whole row for all the users 1 time a day (12:00:01 AM)

It needs to get set back to 0 for everyone, is there a way to do this?

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 03 September 2006 - 12:58 PM

Yes. Two things:

#1 - a script that executes the correct UPDATE query.

#2 - either cron on *nix server or Windoze scheduler on a Win server
Legend has it that reading the manual never killed anyone.
My site

#3 paul2463

paul2463
  • Members
  • PipPipPip
  • Advanced Member
  • 955 posts
  • LocationUK

Posted 03 September 2006 - 12:59 PM

use some code like this
<?php

$query = "UPDATE table_you_need_to_update SET row_you_need_to_update = '0'";
mysql_query($query);


?>

and set uip a cron job on your server to run it when you want it running
you cannot affect the past but you can ruin a perfectly good present by worrying about the future

*********************************************************************
The <A HREF="http://www.php.net/d...php">MANUAL</A> is actually a useful resource




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users