SELECT * FROM tab1 LEFT JOIN tab2 ON tab1.id = tab2.id WHERE tab1.ida = $num