Current location: Hot Scripts Forums » Programming Languages » PHP » Php "Search by Date" in MySQL...


Php "Search by Date" in MySQL...

Reply
  #1 (permalink)  
Old 01-14-04, 01:08 AM
budiarto budiarto is offline
New Member
 
Join Date: Aug 2003
Location: Jakarta
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Php "Search by Date" in MySQL...

Hi,

Anybody know how to do a "search by date" with php.?

For example:
I have customers table in MySQL and I want to search all customers who have birthdate between Jan01-2003 and Feb01-2003.

Any help are greatly appreciated.

regards,

Budiarto.
+++++++++++++
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 07:15 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Reply With Quote
  #3 (permalink)  
Old 01-15-04, 12:15 AM
budiarto budiarto is offline
New Member
 
Join Date: Aug 2003
Location: Jakarta
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,

I can't seem to find what I'm looking for in the URL you gave.
Any specific examples..?

B.
+++++++++++++++++

Quote:
Originally Posted by Infinite_Hackers
Reply With Quote
  #4 (permalink)  
Old 01-15-04, 12:23 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Infinite_Hackers
$query = 'SELECT * FROM records WHERE ' . $t . ' REGEXP ' . $trimmed;

try that
you can change the records to date (the row name)
Reply With Quote
  #5 (permalink)  
Old 01-16-04, 07:41 AM
budiarto budiarto is offline
New Member
 
Join Date: Aug 2003
Location: Jakarta
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Infinite_Hackers.., thanks for the info.

I also try something easier and works fine:

query= "select * from tablename where date_column betwen condition1 AND conditions2" ;

the format of condition1 and condition2 must be "yyyymmdd" not "yyyy/mm/dd" nor "yyyy-mm-dd".

If anybody can tell me a better way, I really appreciate it..

Budiarto.
--------------


Quote:
Originally Posted by Infinite_Hackers
you can change the records to date (the row name)
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Need Epinions-lite system in PHP & MYSQL wali001 Job Offers & Assistance 4 01-12-04 06:02 AM
Connect to MySQL with PHP demiann PHP 3 01-11-04 02:24 PM
MySQL with PHP question. HELP for a newbie kenfused PHP 3 08-02-03 12:53 AM
Free PHP, Perl and possible mySQL hosting! toby General Advertisements 8 06-17-03 01:04 AM


All times are GMT -5. The time now is 08:29 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.