Jump to content

date time current value


ebchost

Recommended Posts

i try tu insert current date and time, but, value inserted in table is 0000-00-00 00:00:00 all the time (wth no value)

 

[syntax=php]$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());[/syntax]

 

wer is the probelm?

Link to comment
https://forums.phpfreaks.com/topic/239959-date-time-current-value/
Share on other sites

The mysql CURDATE() function returns a string (they way you are using it), so it does not get enclosed by single-quotes inside the query.

 

Enclosing it in single-quotes makes it a string, made up of the following characters - C, U, R, D, A, T, E, (, and )

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.