$myQuery=$dbc-> prepare ('SELECT title FROM myTable1
WHERE id = ?');
The above works fine.
I have a variable for the table name “myTable1” like the following.
$tableName = 'myTable1';
$myQuery=$dbc-> prepare ('SELECT title FROM $tableName
WHERE id = ?');
The code above produces the result below.
How can I use a variable for the table name without the Fatal error above ?