Hello,
I have an html form that users fill out the following fields: <article-name><article-date><article-description>
Im testing it out and when you submit the form, article-description submits into the data base, and article-name submits into the database, and article-date does as well...However for some reason if I put 2008-10-05 in the text box it submits into the database as 0000-00-00, and the article name isn't submitting at all
Would anyone know why that is happening? Ive included the SQL from the table I have created in PHPMyAdmin, and the php code that does the inserting...thanks
Code: Select all
CREATE TABLE `legion`.`cadet_Testing` (
`id` INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`articlename` TEXT NOT NULL ,
`date` DATE NOT NULL ,
`description` VARCHAR( 100 ) NOT NULL
) ENGINE = MYISAMCode: Select all
<?php
$con = mysql_connect("***","***","***") or die('Could not connect: ' . mysql_error());
mysql_select_db("***", $con);
$sql="INSERT INTO cadet_Testing (articlename, date, description) VALUES ('".$_POST['articlename']."','".$_POST['date']."','".$_POST['description']."')";
$query = mysql_query($sql,$con) or die('Error: ' . mysql_error());
if ($query)
{
echo "Your Event has been added";mysql_close($con);
}
else
{
echo "Not added.";
}
?>