I code the following function to print the current server date,
function foxdate()
{
$dat_ = getdate();
printf($dat_['year']."-".$dat_['mon']."-".$dat_['mday']);
}
This function prints the current date very well in form YYYY-MM-DD, which is the same format with date format in MySQL.
But The problem in mysql_query some thing like that,
$sql = "INSERT INTO tab1 (name, tel, theDate) VALUES ('$nom', '$te'l, 'foxdate()')";
mysql_query($sql);
Every thing goes well with no any error message but the record in the theDate field remains as 0000-00-00.
So Why MySql cannot accept the out put of foxdate().
Note
theDate field has Date data type in the table properties.
Please Help Me
Regards 😕