- Has been a member for 3-4 years
- Exclusive Author
- Sold between 1 and 100 dollars
- Bought between 50 and 99 items
- United States
- Referred between 50 and 99 users
Ok, so I’m trying to setup the API to allow requests that filter the results by using multiple “WHERE” conditions… However, I keep getting this error:
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 AND' at line 1
Here’s the API setup call:
$api = new Api($db);
$api->register('quotes')
->setTable('quotes')
->setOutput(array(
'xml'
))
->setKey(true)
->setColumns(array(
'id',
'author',
'text',
'category',
'citation',
'adult_lang',
'release_ver'
))
->setWhere(array(
'category' => array(
'route' => 'category',
'connect' => 'AND'
),
'author' => array(
'route' => 'author',
'connect' => 'AND'
)
))
->setLimit(200);
$api->render($_GET);
Any ideas?



100 Purchases
26 Comments