Hi, I made a Reset Script to be run by a Cronjob and the script is
<?php
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?
cant any1 help me?
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
}