[PHP-DB] Problems with ereg-Command

2007-09-06 Thread Ruprecht Helms
Hi, I have some problems with validating the values of the fields street, phone and fax. In the field street I want that only the european standard for writing ( number name or name. number) should be possible. By other fieldentries the user should be informed of the error and the proccessing

[PHP-DB] date problems

2007-09-06 Thread rDubya
I'm having a problem with dates in php and mysql. I run a site that promotes dated events and concerts and has the information for each stored in a mysql database with the timestamp field. Here is the function that checks the date of the event to ensure it is between now and three weeks from now

RE: [PHP-DB] date problems

2007-09-06 Thread Instruct ICC
From: rDubya [EMAIL PROTECTED] My problem is that I have events dated for Sep 2007 and on, and yet they all come up as being on Dec 7 to 9, 2006.. any ideas? rDubya How about having MySQL only return the events you are interested in? SELECT yourEventFields FROM theTable WHERE TO_DAYS(

Re: [PHP-DB] date problems

2007-09-06 Thread Mike Gohlke
It's much better to use add_date instead of to_days since mysql isn't smart enough to do it for you. Such as: SELECT yourEventFields FROM theTable WHERE theEventDate BETWEEN now() AND date_add(now(), INTERVAL 21 DAYS; This way mysql will calc the now() and date_add and will essentially convert

Re: [PHP-DB] date problems

2007-09-06 Thread Mike Gohlke
Argh, make sure you add the closing paren for the date_add since I forgot it. Mike... Mike Gohlke wrote: It's much better to use add_date instead of to_days since mysql isn't smart enough to do it for you. Such as: SELECT yourEventFields FROM theTable WHERE theEventDate BETWEEN now() AND

Re: [PHP-DB] date problems

2007-09-06 Thread rDubya
Thanks for the help so far guys!! Not helping though. I have the date contained in the database as timestamp (-MM-DD HH:MM:SS). The problem is that not only is it not displaying events, but if I alter my code so that it displays ALL events, it shows the events for the last year, and those