dementor Posted September 25, 2007 Posted September 25, 2007 <?php require "mysql.php"; require "../../../../global_func.php"; global $c; mysql_query("UPDATE users set hospital=hospital-5 WHERE hospital>0",$c); ?> anything wrong with it Quote
seanybob Posted September 25, 2007 Posted September 25, 2007 Re: HOSPITAL CRON SUDDENLY STOPS WORKING TOO Moving topic to appropriate board Quote
hamster01 Posted September 25, 2007 Posted September 25, 2007 Re: HOSPITAL CRON SUDDENLY STOPS WORKING TOO <?php require ('mysql.php'); require ('./global_func.php'); mysql_query("UPDATE users set hospital=hospital-5 WHERE hospital >=5", $c); ?> Quote
hamster01 Posted September 25, 2007 Posted September 25, 2007 Re: HOSPITAL CRON SUDDENLY STOPS WORKING TOO mysql_query("UPDATE users SET hospital = hospital WHERE userid = ".$ir['userid'].""); Pointless, and forgetting and variable or two? And what is it with these spaces? Also, why do you need to move the cron, in my example it will automatically select that file from the www root. Quote
hamster01 Posted September 25, 2007 Posted September 25, 2007 Re: HOSPITAL CRON SUDDENLY STOPS WORKING TOO Ah, Missed that, Being awake 15 minute before writing something generally means mistakes will happen, So thanks for pointing that out. d: I woke up an hour ago, or so i think. Spaces does't bother me, just asking, I like questions, it's interesting for me to find answers to random questions. occasionally, I ask a random question to people, and I get either a weird look from them, or a weird answer. The $c variable is only needed when there is more than one connection present, or when it is used in a class, then you have to declare it and call it. Take for instance the following scripts. con.php <?php class settings { var $connection; function cm() { $connection = mysql_pconnect('127.0.0.1','root',''); return $connection; } } ?> util.php <?php require('con.php'); $sett = new settings(); $c = $sett->cm(); $res_o = mysql_query("SELECT TABLE_NAME FROM ALL_TABLES") ? 'true' : 'false'; $res_t = mysql_query("SELECT TABLE_NAME FROM ALL_TABLES", $c) ? 'true' : 'false'; echo 'Without : ' . $res_o . ' - With : ' . $res_t; ?> Test it, the output will be the following: Without : false - With : true But what I actually meant is, the variable you just edited in, calc. Quote
dementor Posted September 25, 2007 Author Posted September 25, 2007 Re: HOSPITAL CRON SUDDENLY STOPS WORKING TOO dw about my 5 miute thing its just simepler for me i know what i am doing Quote
dementor Posted September 25, 2007 Author Posted September 25, 2007 Re: HOSPITAL CRON SUDDENLY STOPS WORKING TOO by the way your fixes dont work Quote
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.