nani_nisha06
10-07-2012, 06:22 PM
HI frnds,
can any one please help me to post dd-mm-yyyy date format to Mysql which is yyyy-mm-dd.
I am struggling lot to solve this but could not able to success it....
my php code is :
<?php
session_start();
$host="localhost"; // Host name
$username="#############"; // Mysql username
$password="##########"; // Mysql password
$db_name="#########"; // Database name
$tbl_name="#########"; // Table name
$myusername = $_SESSION['myusername']; //user who updating
$con = mysql_connect("$host","$username","$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="INSERT INTO $tbl_name(`Creation_Date`, `Resolved_Date`, `Analyst`, `Email_Address`, `Status`, `Mail_Sent`, `Call_Made`, `Doc_verf`, `Change2analyst`, `Change3analyst`)
VALUES
('$_POST[requiredCD]','$_POST[requiredRD]','$myusername','$_POST[requiredEmail]','$_POST[Status]','$_POST[MailSent]','$_POST[Call]','$_POST[Docverf]','$_POST[Analyst2]','$_POST[Analyst3]')";
$result1=mysql_query($sql)or die(mysql_error());
{
header("location:new_user.php") or die("record not inserted");
}
mysql_close();
?>
Any help is most appreciated !!!!
Regards,
Nani
can any one please help me to post dd-mm-yyyy date format to Mysql which is yyyy-mm-dd.
I am struggling lot to solve this but could not able to success it....
my php code is :
<?php
session_start();
$host="localhost"; // Host name
$username="#############"; // Mysql username
$password="##########"; // Mysql password
$db_name="#########"; // Database name
$tbl_name="#########"; // Table name
$myusername = $_SESSION['myusername']; //user who updating
$con = mysql_connect("$host","$username","$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="INSERT INTO $tbl_name(`Creation_Date`, `Resolved_Date`, `Analyst`, `Email_Address`, `Status`, `Mail_Sent`, `Call_Made`, `Doc_verf`, `Change2analyst`, `Change3analyst`)
VALUES
('$_POST[requiredCD]','$_POST[requiredRD]','$myusername','$_POST[requiredEmail]','$_POST[Status]','$_POST[MailSent]','$_POST[Call]','$_POST[Docverf]','$_POST[Analyst2]','$_POST[Analyst3]')";
$result1=mysql_query($sql)or die(mysql_error());
{
header("location:new_user.php") or die("record not inserted");
}
mysql_close();
?>
Any help is most appreciated !!!!
Regards,
Nani