I've got a query that pulls values from multiple tables. I wish to organize them by shows_date ASC only I cant appear to have it to ouput data, Can anybody see an issue with my syntax?

$artists = $wpdb->get_results("SELECT * FROM " . GIGPRESS_ARTISTS . " AS a, " . GIGPRESS_SHOWS . " AS s, ORDER BY s.show_date ");

var_dump($artists);

foreach($artists as $artist_group) 
{
    $shows = $wpdb->get_results("SELECT * 
                                 FROM " . GIGPRESS_ARTISTS . " AS a, " . GIGPRESS_VENUES . " as v, " . GIGPRESS_SHOWS ." AS s 
                                 LEFT JOIN  " . GIGPRESS_TOURS . " AS t 
                                   ON s.show_tour_id = t.tour_id 
                                 WHERE " . $date_condition . " 
                                   AND show_status != 'deleted' AND s.show_artist_id = " . $artist_group->artist_id . " 
                                   AND s.show_artist_id = a.artist_id AND s.show_venue_id = v.venue_id " . $further_where . " 
                                 ORDER BY s.show_date " . $sort . ",s.show_expire " . $sort . ",s.show_time ". $sort . $limit);
}

DUMP RETURNS

array(72) title"]=> string(14) "Damien Dempsey" ["artist_order"]=> string(1) "" ["show_id"]=> string(1) "1" ["show_artist_id"]=> string(1) "1" ["show_venue_id"]=> string(1) "1" ["show_tour_id"]=> string(1) "" ["show_date"]=> string(10) "2012-01-29" ["show_multi"]=> string(1) "" ["show_time"]=> string(8) "20:30:00" ["show_expire"]=> string(10) "2012-01-29" ["show_cost"]=> string(7) "£10.00" ["show_tix_url"]=> string() "" ["show_tix_phone"]=> string() "" ["show_age range"]=> string(8) "Any Age" ["show_notes"]=> string() "" ["show_related"]=> string(1) "" ["show_status"]=> string(7) "erased" ["show_tour_restore"]=> string(1) "" ["show_address"]=> NULL ["show_locale"]=> NULL ["show_country"]=> NULL ["show_venue"]=> NULL ["show_venue_url"]=> NULL ["show_venue_phone"]=> NULL [1]=> object(stdClass)#259 (25) title"]=> string(10) "Gary Dunne" ["artist_order"]=> string(1) "" ["show_id"]=> string(1) "1" ["show_artist_id"]=> string(1) "1" ["show_venue_id"]=> string(1) "1" ["show_tour_id"]=> string(1) "" ["show_date"]=> string(10) "2012-01-29" ["show_multi"]=> string(1) "" ["show_time"]=> string(8) "20:30:00" ["show_expire"]=> string(10) "2012-01-29" ["show_cost"]=> string(7) "£10.00" ["show_tix_url"]=> string() "" ["show_tix_phone"]=> string() "" ["show_age range"]=> string(8) "Any Age" ["show_notes"]=> string() "" ["show_related"]=> string(1) "" ["show_status"]=> string(7) "erased" ["show_tour_restore"]=> string(1) "" ["show_address"]=> NULL ["show_locale"]=> NULL ["show_country"]=> NULL ["show_venue"]=> NULL ["show_venue_url"]=> NULL ["show_venue_phone"]=> NULL [2]=> object(stdClass)#261 (25) title"]=> string(19) "London Irish Center" ["artist_order"]=> string(1) "" ["show_id"]=> string(1) "1" ["show_artist_id"]=> string(1) "1" ["show_venue_id"]=> string(1) "1" ["show_tour_id"]=> string(1) "" ["show_date"]=> string(10) "2012-01-29" ["show_multi"]=> string(1) "" ["show_time"]=> string(8) "20:30:00" ["show_expire"]=> string(10) "2012-01-29" ["show_cost"]=> string(7) "£10.00" ["show_tix_url"]=> string() "" ["show_tix_phone"]=> string() "" ["show_age range"]=> string(8) "Any Age"


Ive attempted the next

foreach($artists as $artist_group) {
        $shows = $wpdb->get_results("SELECT * FROM " . GIGPRESS_ARTISTS . " AS a, " . GIGPRESS_VENUES . " as v, " . GIGPRESS_SHOWS ." AS s LEFT JOIN  " . GIGPRESS_TOURS . " AS t ON s.show_tour_id = t.tour_id WHERE " . $date_condition . " AND show_status != 'deleted' ORDER BY s.show_date ASC " . $limit);

Which works regarding the ordering, however it results each value about 100 occasions or something like that stupid..

the comma after AS s, is extraneous

Choose * FROM " . GIGPRESS_ARTISTS . " AS a, " . GIGPRESS_SHOWS . " AS s, ORDER BY s.show_date

furthermore you appear to become missing a WHERE clause or perhaps a JOIN ON statement.

this question would create a mix-join with (all gigs) x (all bands) to ensure that inside your foreach you'll process each band once for each gig within the system, rather than once for every band/show.