You are here: datetime compare question « PHP SQL « IT news, forums, messages
datetime compare question

Posted by Alan Robertson on 09/28/99 11:30

Apologies for asking such a stupid question, but I've just spent the last
four hours trying to solve it myself and failed!
I'm a complert enovice at this php/mysql thing so I'll just get straight
into it.

I have create mysql db that has a field 'start_date' in the datetime format.
I also have a string in PHP formated as $expiry = date("Y-m-d H:i:s").

All I want is a select query that will return the rows of data where the
'start_date' field is less than the $expiry variable.
But I am having no luck what so ever.

$query = "SELECT * FROM `tbl_markets` WHERE 'start_date' < '$expiry'";

Not exactly rocket science - but I'm pulling my hair out here.

can anyone think what i need to do. I've tried using DateFormat on the
'start_date' incase it gets converted into a string from mysql, but that
didn't make any difference either.


Regards
Alan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация