Has anyone ever used tokens with the DB::query method?
The code following works fine:
$psurname = 'Smith';
$sql = "...
WHERE per.surname like '$psurname'
...";
$result = $db->query($sql);
But when I attempt this :
$psurname = 'Smith';
$sql = "...
WHERE per.surname like ?
...";
$result = $db->query($sql, array($psurname));
I get no records returned from the database, and when I try:
$psurname = 'Smith';
$sql = "...
WHERE per.surname like !
...";
$result = $db->query($sql, array('Smith');
I get the following error:
Has anyone managed to get this use of tokens to work?