why will the following query not work?
$q=$conn->prepare("SELECT GUID FROM :table WHERE URL = :url AND Status = 1 LIMIT 0,1");
$q->execute(array(':table'=>'su_prm_'.$url_params['leading_url'],':url'=>$url_params['trailing_url']));
$r=$q->rowCount();
//returns 0, should return 1. Querying from the console (with quotes) returns 1.
I thought perhaps there was an issue whereby the variable strings were not being parsed as strings, so tried
$q->bindParam(1, 'su_prm_'.$url_params['leading_url'], PDO::PARAM_STR);
$q->bindParam(2, $url_params['trailing_url'], PDO::PARAM_STR);
also tried placing the variables into new, standalone vars ($str = 'su_prm_'.$url_params['leading_url']
) and running the query that way. No luck. What am I missing?
EDIT: btw, the strings are 'stream' and 'general'. Nothing fancy...