Hi Guys
I'm having a little problem with fetching data from 2 or more tables from the same db. I'm using 2 methodes:
1.
$sql_emp = "SELECT a.*, b.points FROM `table_users` AS a, `table_points` AS b WHERE b.user_id=a.id ORDER BY a.surname ";
2.
$sql_emp = "SELECT a.id,a.name,a.surname,b.points FROM a LEFT JOIN b ON b.user_id = a.id ";
Methode 1 is working but my problem is when table b has no entry it's not returning anything. In other words say there is 10 employees stored in table a and only 2 employees have points entries in table b my query only return 2. Is there a way to join tables that I can get all the entries from table a even if there is no entries in table b?