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 'and length(published)>0 order by sort asc, phDate desc' at line 1
select phId, phNamero, date_format(phDate,'%d.%m.%Y') from tbpphoto where sprId= and length(published)>0 order by sort asc, phDate desc
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/rybaleov/public_html/photoschool/classes/class.main.php on line 155