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 sections.active = 1
AND pages.active = 1' at line 5
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/stephens/public_html/inc/generate_sections.php on line 23