Page 1 of 1

date time value

Posted: Tue Jun 21, 2011 6:39 am
by hostingebc
i try tu insert current date and time, but, value inserted in table is 0000-00-00 00:00:00 all the time
$sql = "INSERT INTO `rss_vesti` SET 
	`SAJT_ID`	= '$rss_izvor_id',
	`NASLOV` 	= '$title1',
	`SLIKA`		= '$image2', 
	`SADRZAJ`	= '$descritpion_trim1',
	`IZVOR`		= '$link1',
	`DATUM`		= 'CURDATE()'";

mysql_query($sql)or die(mysql_error());
wer is the probelm?

Re: date time value

Posted: Tue Jun 21, 2011 6:59 am
by hostingebc
Solved

$datum = date('Y-m-d H:m:s');

Re: date time value

Posted: Tue Jun 21, 2011 12:14 pm
by jacek
you could also use the mysql NOW() function in place of the CURDATE() one you have above.