I try to do a prepared SELECT statement with PDO in php. This is my statement:
# named placeholders
$STH = $DBH->("SELECT * FROM `highscore_ranked` WHERE DeviceID = :deviceid ORDER BY Points DESC LIMIT 0 , 10");
$STH->bindValue(':deviceid', $DeviceIDClear);
# setting the fetch mode
$STH->setFetchMode(PDO::FETCH_ASSOC);
$STH->execute();
But I got the error:
PHP Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$'
on this line:
$STH = $DBH->("SELECT * FROM `highscore_ranked` WHERE DeviceID = :deviceid ORDER BY Points DESC LIMIT 0 , 10");
I don’t know what’s wrong at this line.
You forgot the name of the method!!!!