"afrinspray" <> wrote:
> Yeah exactly.
Exactly what? Please quote some context.
> That's why I'm using a prepare with "use ?"
*What* is why you are using a prepare with "use ?"?
>
> In short, w/o error checking:
> $sth = $dbh->prepare("use ?");
> loop dbs into $dbname {
Er, that is not Perl. Looks kind of like PL/SQL
> $sth->execute($dbname);
> }
> $sth->finish();
>
> Can you see any problems with this?
Yes. Placeholders do not work in this context. A placeholder signifies
data, and database names are not considered data, they are considered
metadata.
This is the exception to the rule to almost always use placeholders.
Plug the database name directly into the string without using placeholders.
If the database name is funky, use the DBI method "quoteidentifier" and
pray that it does what it is supposed to under MySQL.
Xho
--
--------------------
http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB