Hi!
I am currently trying to insert a table name from an scalar into an sql prepare, is this possible in some way? (I am trying to make a multi-user blogging system)
The code I am trying to use looks like this:
$sth = $dbh->prepare('update ? set header = ? where id = ?');
$execute_result = $sth->execute($table, $header, $id);
And the scalar $table contains the table name
This does not work, the server only reports an error in the sql syntax.
Does anybody know a way to work around this? Or some other way to do the same thing?
Thanks in advance, and pardon my bad english!
Best regards,
Jo Andreas
I am currently trying to insert a table name from an scalar into an sql prepare, is this possible in some way? (I am trying to make a multi-user blogging system)
The code I am trying to use looks like this:
$sth = $dbh->prepare('update ? set header = ? where id = ?');
$execute_result = $sth->execute($table, $header, $id);
And the scalar $table contains the table name
This does not work, the server only reports an error in the sql syntax.
Does anybody know a way to work around this? Or some other way to do the same thing?
Thanks in advance, and pardon my bad english!
Best regards,
Jo Andreas