php - Mysql Unix Timestamp Store? -


I have found a little bit of a problem here. Unix stamps my database as a string 2011-09-01 20:22:36 and stores me as a Unix timestamp ############ Is required, so I can compare it by comparing it to a & gt; So the symbol but I also need to set the timestamp automatically on the update ( updated current timestamp ) as well as the timestamp default which is not really important The reason I can do this in PHP is if I need it.

How can I do this? Timestamp Now is a date / time combo string and not an integral, so I can not compare it?

My comparison string

$ sql = Sprintf ("SELECT nid, field_date_value, where field_movie_location_value is updated with content_type_mobile_event & lt; '% s'", $ vid) ;

Anybody is thinking.

Use it to convert it to your query. If you should compare it to a PHP from a Unix timestamp, then MySQL is the easiest to allow the conversion of columns to handle at the end.

  $ sql = sprintf ("SELECT nid, other timers from content_type_mobile_event WHERE UNIX_TIMESTAMP (updated) & lt; '% s'", $ vid);    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -