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
https://forums.phpfreaks.com/topic/261499-date-problems-involving-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.