Click here for Toll-Free Service for your business starting at $2.00 per month

Main Menu

Reset Script

Started by Ries, January 23, 2006, 01:11:47 PM

Previous topic - Next topic


Hi, I made a Reset Script to be run by a Cronjob and the script is

mysql_connect ("localhost", "eluxian", "****") or die ('I cannot connect to the database because: ' . mysql_error());
   mysql_select_db ("eluxian");

mysql_query("UPDATE userdb SET energy_max='10'")or die(mysql_error());
$result = mysql_query("UPDATE userdb SET energy_now=energy_max")or die(mysql_error());

$result = mysql_query($sql);
P.S the password is really like that i hashed it out for the post

But it doesn't work, its supposed to set energy_now to energy_max but it doesn't work. But it did the other way around.
I have checked the connection line with pass and user thats fine, the db is fine and the tables are fine also the collums are in the db but it doesn't work, Any ideas?



I fixed it, its fine now


Quote from: Ries on January 25, 2006, 07:45:22 PM
I fixed it, its fine now

An alternative to your orginal method would be to use mysql_fetch_array to get teh value of energy_max into a variable and then set energy_now to that value. :D
Visite me website at