I would like to pass a variable directly into the select statement to identify the table, so the code recognizes SELECT * FROM us_total_Y
. Is this possible with PDO? I have googled around and looked through three books but don't see an example. Would anyone know? Thank you in advance.
$loc = 'us';
$stmt = $pdo->prepare('SELECT * FROM :loc _total_Y');
$stmt->execute(array('loc' => $loc));