select * from erber_immobilien_fotos where immobilie = order by pos ASC

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by pos ASC' at line 1