Linked Questions

Popular Questions

multiple sort fields on multiple tables without join sql

Asked by At

How to do multiple sort without Join on tables? I'm able to sort fine by audDt but I'm unable to do a secondary sort on siteSt. Here is my code:

$sorc451sql = "Select * FROM table1 ORDER BY audDt";
while ($sorc451row = mysqli_fetch_array($sorc451res)) {
    $sorc451arycust[$i][6]  = $sorc451row['gropID'];


    $sorc452sql = "Select * FROM table2 WHERE gropID=".$sorc451arycust[$i][6];
    while ($sorc452row = mysqli_fetch_array($sorc452res)) {
        $sorc452arycust[$i][12]  = $sorc452row['siteSt'];
    }
}

Related Questions