urbandsigns.com Posted August 4, 2006 Share Posted August 4, 2006 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 https://forums.phpfreaks.com/topic/16569-dateadd-help/ Share on other sites More sharing options...
paul2463 Posted August 4, 2006 Share Posted August 4, 2006 Have you defined the DateAdd() function anywhere in your programas far as I am aware there is no pre-defined function of that name in PHP. Link to comment https://forums.phpfreaks.com/topic/16569-dateadd-help/#findComment-69341 Share on other sites More sharing options...
urbandsigns.com Posted August 4, 2006 Author Share Posted August 4, 2006 No I didn't, I assumed DateAdd was a PHP function. Guess I better look into it more. Link to comment https://forums.phpfreaks.com/topic/16569-dateadd-help/#findComment-69355 Share on other sites More sharing options...
fenway Posted August 4, 2006 Share Posted August 4, 2006 I have no idea what these data represent, by MySQL can do a fair bit of date math for you. Link to comment https://forums.phpfreaks.com/topic/16569-dateadd-help/#findComment-69451 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.