VegasKiller Posted July 22, 2010 Posted July 22, 2010 When I run my page I get this print out. -1 affected rows during this query. also my weather is not updating correctly. The time remaining stays at 0 always, And it is always raining, I think ive seen it snowing once so it may change the weather but not the time remaining. Pls help me get this working as it is a major thing in my game. thnx /// Weather Starts Here /// mysql_query("UPDATE weather_status SET remaining_minutes=remaining_minutes-1 WHERE remaining_minutes>0",$c); $wi=mysql_query("SELECT ws.*,w.* FROM weather_status ws LEFT JOIN weathers w ON ws.weather=w.w_id LIMIT 1;",$c); $w=mysql_fetch_array($wi); if($w['remaining_minutes'] == 0) { $weather=mysql_fetch_array(mysql_query("SELECT * FROM weathers ORDER BY rand() LIMIT 1;",$c)); $chance=rand(1,$weather['w_chance']*20); if($weather['w_chance'] < $chance) { $weather=mysql_fetch_array(mysql_query("SELECT * FROM weathers ORDER BY rand() LIMIT 1;",$c)); } $chance=rand(1,$weather['w_chance']*20); if($weather['w_chance'] < $chance) { $weather=mysql_fetch_array(mysql_query("SELECT * FROM weathers ORDER BY w_chance DESC LIMIT 1;",$c)); } $w2c=$weather['w_id']; mysql_query("UPDATE weather_status SET weather={$w2c} LIMIT 1;",$c); mysql_query("UPDATE weather_status SET remaining_minutes=rand(1,60) WHERE remaining_minutes=0",$c); } print mysql_affected_rows($c)." affected rows during this query. "; /// Weather Ends Here /// also in my header. I put my mouse over the weather icon and it says for next 0 minutes. so it is not showing the type of weathers name. $ws=mysql_query("SELECT * FROM weather_status",$c); $rws=mysql_fetch_array($ws); $tws=mysql_query("SELECT * FROM weathers",$c); $fws=mysql_fetch_array($tws); echo "<td valign='right' width='60'> ?( 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.