On my index page I have the "latest work" which shows 8 portfolio pieces and I need it to only grab the ones that have active = 1 as well and I have something like this:
$sql = 'SELECT * FROM portfolio WHERE active = 1';
I tried doing this but its not working and i get errors when I try to pass it in PHPMyAdmin as well.
$sql = 'SELECT * FROM portfolio
WHERE active = 1
WHERE [id] > SELECT
MAX([id]) - 8 FROM portfolio';
Any ideas?