Re: [PHP] Multiple Tables Select
Bob Irwin wrote: What I am getting is not accurated, it just seems to grab the one entry, which is correct, but there are 3 entries that fall within the range I am trying to select on. What are the other two records you think ought to be returned? I feel the sql statement probably gets the correct number of records, but possibly you are not seeing why the others do not match. Alternatively, the code is only getting the first row and not the rest (show code that loops round all records)? HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple Tables Select
G'day, Hoping someone can help me with a mysql select statement. I have two tables that I am trying to do a select on. The basic table details are below. table name: time | ID | timefinished| status | |1| 11 |C | table name: details | sid | completedby | | 1 | bob | sid and ID are always the same corresponding value (one is inserted based on the other). What I am trying to do is do a select based on the current date and status and then by who it was completed by. What I have is... select * from time, details where time.timefinished between '10' and '12' and time.status='C' and details.completedby='bob' and time.ID = details.sid; What I am getting is not accurated, it just seems to grab the one entry, which is correct, but there are 3 entries that fall within the range I am trying to select on. Any ideas what I'm doing wrong? Any help is greatly appreciated. Been staring at the monitor for a while dribbling :) Best Regards Bob Irwin Server Admin Web Programmer Planet Netcom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php