i am a newbie. Tired of searching through net if someone could help me. How to insert the date value through js datepicker showing the user in “dd-mm-yyyy” format.
date.html
save.php
<?php
$host=“localhost”;
$username=“root”;
$password="";
$databasename=“saving”;
$conn = mysql_connect($host,$username,$password) or die(“cannot connect database”);
mysql_select_db($databasename,$conn) or die (“cannot find database”);
$thedate = stripslashes(trim ($_POST[‘thedate’]));
$select_record =“select * from only where thedate =’”.$thedate."’";
$select_query = mysql_query($select_record) or die (mysql_error());
if (mysql_numrows($select_query)==0)
{
$thedate = stripslashes(trim($_POST[‘thedate’]));
$add_new = “insert into only (thedate) values (’$thedate’)”;
$add_query = mysql_query($add_new) or die (mysql_error());
if ($add_query)
{
echo “New Record Added !!”;
}
}
else
echo “Not Added”;
?>