Working with MySQL but not php

Hey guys,

Ive got a query here that works in phpMyAdmin but turns an error via php…

SELECT afflinks.id, aff.id, aff.name, aff.parent, aff.child, aff.afflink, aff.afforig, affpages.id, affpages.name, affpages.localurl 

FROM afflinks 
LEFT JOIN aff ON aff.id=afflinks.aid 
LEFT JOIN affpages ON affpages.id=afflinks.pid 
WHERE `afflinks.id` = 19 
ORDER BY afflinks.id DESC LIMIT 0,10

error: …for the right syntax to use near ‘= 19’ at line 1

and without the ``'s

right syntax to use near ‘.id = 19’ at line 1

cheers