0

Is there any way that one could bind a parameter directly to the connection variable so it could be replaced in every prepared statement?

Could this work? :

$database = 'users';
$pdo_conn = connection variable;
$pdo_conn->bindValue(':usersdb', $database, PDO::PARAM_STR);

// Query
$pdo_query = $pdo_conn->prepare("SELECT * FROM :usersdb.users");

Thanks in advance!

Andrei Vlad
  • 215
  • 2
  • 10

0 Answers0