Through the prompt method ,i'm taking the name of the person to create a table .The method is working and the name is being parsed by the php script .But no matter what ,the table is not getting created and getting the following
ERROR: Could not able to execute CREATE TABLE kat (Item VARCHAR(50) , Quantity INTEGER, Price REAL).
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 'kat (Item VARCHAR(' at line 1 "
echo("<script type='text/javascript'> var answer = prompt('Enter name'); </script>");
$na= "<script type='text/javascript'> document.write(answer); </script>";
$sql = "CREATE TABLE $na (Item VARCHAR(50) , Quantity INTEGER, Price REAL)";
if(mysqli_query($conn, $sql)){
echo "Table created successfully.";}
else {
echo "ERROR: Could not able to execute $sql. " . mysqli_error($conn);
}