# Working with MySQL but not php

**URL:** <https://forum.kirupa.com/t/working-with-mysql-but-not-php/286369>\
**Category:** programming\
**Created:** [April 14, 2009, 3:49pm UTC](https://forum.kirupa.com/t/working-with-mysql-but-not-php/286369 "2009-04-14T15:49:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FreakSheep](https://avatars.discourse-cdn.com/v4/letter/f/d9b06d/32.png) [@FreakSheep](https://forum.kirupa.com/u/FreakSheep)\
**Post date:** [April 14, 2009, 3:49pm UTC](https://forum.kirupa.com/t/working-with-mysql-but-not-php/286369/1 "2009-04-14T15:49:52Z")

</div>

Hey guys,

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

```auto
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
