ps... from a PHP perspective, you may find troubleshooting things like this
easier by using formatting like this:

$sql = "
        select 
                detail.*,
                type.type_name,
                status.status_name,
                staff.staff_name,
                source.source_long,
                source.source_short from detail,
                type, status, staff,
                source
        where 
                type.type_id = detail.detail_type && 
                status.status_id = detail.detail_status &&
                staff.staff_id = detail.detail_staff && 
                source.source_short = > detail.detail_source && 
        
'detail_start_date_y,detail_start_date_m,detail_start_date_d,detail_start_ti
me_h,detail_start_time_m' <= '$ttwo'
        order by
                detail.detail_start_date_m DESC, 
                detail.detail_start_date_d DESC
        ";

$dbq = select($sql);




> -----Original Message-----
> From: Chris Kay [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 13, 2002 4:33 PM
> To: PHP General List
> Subject: [PHP] MySQL Query Help!!!!
> 
> 
> 
> I have a rather longer query which I would like to get all 
> records past todays date.
> Here is my query
> 
> $ttwo = date("YmdGi");
> 
> $dbq = select("select detail.*, type.type_name, 
> status.status_name, staff.staff_name, source.source_long,
> source.source_short from detail, type, status, staff,
> source where type.type_id = detail.detail_type && 
> status.status_id = detail.detail_status &&
> staff.staff_id = detail.detail_staff && source.source_short = 
> detail.detail_source && 
> 'detail_start_date_y,detail_start_date_m,detail_start_date_d,d
> etail_start_time_h,detail_start_time_m' <= '$ttwo' order by 
> detail.detail_start_date_m DESC, detail.detail_start_date_d DESC");
> 
> The query works fine before I try to get all records in the 
> furure as shown below
> 
> 'detail_start_date_y,detail_start_date_m,detail_start_date_d,d
> etail_start_time_h,detail_start_time_m' <= '$ttwo'
> 
> The query does not error out it just does not give any 
> records, and I know there are 4 records
> 
> Detail_start_date_y = 4 digit year
> Detail_start_date_m = 2 digit month
> Deatil_start_date_d = 2 digit day
> Detail_start_time_h = 24 hour time
> 
> Can anyone see what I am doing wrong?
> 
> Thanks in advance.
> 
> --------------------------------------------------------------
> -------------
> Chris Kay
> Technical Support - Techex Communications 
> Website: www.techex.com.au   Email: [EMAIL PROTECTED]
> Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
> Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
> Platinum Channel Partner of the Year - Request DSL - 
> Broadband for Business
> --------------------------------------------------------------
> -------------
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
 
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very
much.                                                                       

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to