| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | whats wrong with this query? I am trying to get all orders associated to a user with a unique $brokerid. There are three tables to be pulled from (dates, order, sales) and the user information is stored in table users. Order holds the primary key `id` and dates / sales contain the foreign key `id` to match. RESOLVED. SELECT DISTINCT o.id, o.status, d.submitdate, s.paymentstatus FROM `order` AS o, `dates` AS d, `sales` AS s, `users` AS u WHERE ( u.userid = o.broker ) && ( u.userid =2 ) && ( o.broker =2 ) && ( s.id = o.id ) && ( d.id = o.id ) ORDER BY `d`.`submitdate` DESC LIMIT 0 , 30 Last edited by DylanButler; 02-16-2007 at 09:34 PM. |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |