Jump to content

DateAdd Help


urbandsigns.com

Recommended Posts

I made a flash AutoX game (http://www.gdub.net/games.php). At the end it sends the lap time & number of cones hit to a php page that takes the information, records it in a MySQL database, and posts the scores. The problem is I have to add the lap time + 1 second for each cone. I did some research and found the DateAdd function which in theroy should work, but it doesn't. Below is my code, everything works except the $total2 section with the DateAdd function:

[code]<?
$name = $_GET["name"];
$score = $_GET["score"];
$cones = $_GET["cones"];
$minutes = $_GET["minutes"];
$seconds = $_GET["seconds"];
$milli = $_GET["milli"];
$total = $seconds + $cones - 1;
$total2 = DateAdd('s', $_GET["cones"], $_GET["score"]);
$result = mysql_query("INSERT INTO ***** (name, score, cones, date, total, total2) VALUES ('$name','$score','$cones',Now(),'$minutes:$total:$milli','$total2')") or die(mysql_error());
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.