How to use variable for table name in DBI query? I know how to use placeholders as part of the where clause, but how do I do this for the table name?
I would like to do something like this:
my $table_name='table1';
my $query = $dbh_cgi->prepare("select * from ?");
$query->execute($table_name);
So far I am getting a MySQL syntax error because the DBI adds quotes around the name, table1.
sutee source
share