I am creating a racing game and hit a snag. Been working on this all day (and most of the night)
I need to set up the races so that players can enter them and race, then when the races is over it resets it with a random 10 to 30 minutes til the next race
I have tried all sorts of things to get this to work. I have gotten closer and closer but here is where I stand now.
lets say a race just ended, instead of resetting the time and adding 10 to 30 minutes, it sets everything to 0, it makes me think the variable is not valid and it tries to enter. this is what I’ve come up with after trying it at least 50 different ways (the error is in the IF statement)
[php]
Car Entered <?php $user="****"; $password="****"; $database="****"; mysql_connect("localhost",$user,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM races";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$query2="SELECT * FROM account";
$result2=mysql_query($query2);
$num2=mysql_num_rows($result2);
$query3="SELECT * FROM tracks";
$result3=mysql_query($query3);
$num3=mysql_num_rows($result3);
$i=0;
$datetimeNOW = date("Y-m-d H:i:s ");
?>
Current date/Time: <? echo $datetimeNOW; ?>
Track | Race Started? | Race Start Time |
---|---|---|
<? echo $Track; ?> | <? echo "not started yet"; ?> | <? echo $RaceStart; ?> |
<? echo $Track; ?> | <? echo "Race Started"; ?> | <? echo $RaceStart; ?> |
Let me know what else I need to post, and thank you very much in advance for any help you can give me, both to fix this problem, and in helping me understand it