I have two tables: Table 1 and Table 2
I need to sort the data as shown in Table View.
I have already taken:
foreach($Table1 as $row1 )
{
foreach($Table2 as $row2 )
{
if($row1->id == $row2->selected_id)
{
show??
}
}
}
please do not worry about queries: it is taken care of real issue is:
there is only one problem: Table 1 is generated from 20 different function and collects to Table 1. and user selects which they want to view by selecting. so, if there is total of 7 rows and user selects 3, so data will be sorted showing 3 rows selected at first rows and rest after the 3 rows.
is this the right way to do it? or is there much easier way I am using MySQL
please help anyone?