Jump to content

Date problems involving php


Pallchrn2

Recommended Posts

problem showing date posted from a form into MYSQL using the php code. Date shows as 0000-00-00 and not the value submitted from the form. Thank you for any help

 


$sql="INSERT INTO Results (RunnerID, EventID, Date, FinishTime, Position, CategoryID, AgeGrade, PB)
VALUES
('$_POST[RunnerID]','$_POST[EventID]','$_POST[Date]','$_POST[FinishTime]','$_POST[Position]','$_POST[CategoryID]','$_POST[AgeGrade]','$_POST[PB]')";

if (!mysql_query($sql,$connection))
   {
   die('Error: ' . mysql_error());
   }
echo "<h1> Success! Saving data: </h1>";

mysql_close($connection);
?>

<html>
<head>
<title>Submitted</title>
</head>
<body>
<br />
<?php echo "RunnerID=" . $_POST["RunnerID"]; ?><br />
<?php echo "EventID=" . $_POST["EventID"]; ?><br />
<?php echo "Date=" . $_POST["Date"]; ?><br />
<?php echo "FinishTime=" . $_POST["FinishTime"]; ?><br />
<?php echo "Position=" . $_POST["Position"]; ?><br />
<?php echo "CategoryID=" . $_POST["CategoryID"]; ?><br />
<?php echo "AgeGrade=" . $_POST["AgeGrade"]; ?><br />
<?php echo "Personal best=" . $_POST["PB"]; ?><br />


</body>
</html> 



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.