MYSQL QUERY NOT SAVING DATE OF BIRTH
Mysql query is not saving the date of birth as expected but only saving it
as 0000-00-00 from a php registration form, what might be the matter?
ThanK You
<?php
if(isset($_POST['registration']))
{
require "connection.php";
$FirstName = strip_tags($_POST['FirstName']);
$LastName = strip_tags($_POST['LastName']);
$Phone = $_POST['Phone'];
$Month = $_POST['month'];
$Day = $_POST['day'];
$Year = $_POST['year'];
$Date = $Year."-".$Month."-".$Day;
mysql_query("INSERT INTO users (FirstName,LastName,Phone,DOB) VALUES ( '"
. $FirstName . "','". $LastName . "','" . $Phone . "','" . $Year . "-" .
$Month . "-" . $Day . "')") or die("".mysql_error());
echo "Successful Registration!";
}
?>
No comments:
Post a Comment