Get blank value if field value is not available
You can change $query-&gt;join to $query-&gt;leftjoin.

This will cause the query to return a row, even if there's no entry in the joined table.

Hope this helps.