why is prepared statement not working for creating tables?

43 views Asked by At

Can someone tell me what is wrong with my code. It is giving a syntax error.

$email = $email."_account";
$stat1 = $conn->prepare("create table ?(acc varchar(50) NOT NULL)");

echo mysqli_error($conn);

$stat1->bind_param("s",$email);
$b = $stat1->execute();

This is the error :

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?(acc varchar(50) NOT NULL)'

Also I would like to ask if I should prepare seperate tables for every user. For example if I am preparing a budget manager software then I need accounts for that. So should I store accounts for every user in same table or create seperate tables for every user?

0

There are 0 answers