There is two tables there is nor relation between both tables,
structure: table_one
+---------+--------+-----------+
| name | age |insertTEMP |
+---------+--------+-----------+
| cat | 12 |02-02-2014 |
| dog | 13 |03-04-2014 |
+---------+--------+-----------+
structure: table_two
+---------+--------+---------------+
| book | pages | insertTEMP |
+---------+--------+---------------+
| book1 | 34 | 05-02-2014 |
| book2 | 54 | 04-03-2014 |
+---------+--------+---------------+
now the idea is here i want to list records from both table so i keep bellow function to list them.
public function recentALL() {
$sql = "select * from table_one, table_two ORDER BY insertTEMP";
$q = $this -> conn -> prepare($sql);
$q -> execute();
return $row = $q -> fetchAll();
}
and i fetch it in the view,
$data2 = $functions->recentAll();
foreach ($data2 as $data3){
echo $data3['name'] . $data3['book'] . '<br />';
}
how i can make it to show like:
+---------+--------+
| cat | NULL |
| null | book1 |
| null | book2 |
| dog | null |
+---------+--------+
this based on the insertTEMP