I have this piece of code and would like to insert a date value to the database, but it keeps writing a string of zeros.
$query = "INSERT INTO Competition VALUES('','$MobileNumber','$RefNo','$KeyWord','NOW()','$Message')";
i have tried using this as well but not inserting even though its echoing the date
$today = localtime();
$today[4] +=1;
$today[5] +=1900;
$PinDate = "$today[3]/$today[4]/$today[5]";
echo "Today is ". $PinDate;
Does anyone know what im doing wrong.
$query = "INSERT INTO Competition VALUES('','$MobileNumber','$RefNo','$KeyWord','NOW()','$Message')";
i have tried using this as well but not inserting even though its echoing the date
$today = localtime();
$today[4] +=1;
$today[5] +=1900;
$PinDate = "$today[3]/$today[4]/$today[5]";
echo "Today is ". $PinDate;
Does anyone know what im doing wrong.