I want to create tables in mySQL with names that include hyphons, full stops, the % symbol and others. The name will be in a variable called image_name. How do I go about this? Of course I could replace all with underscores, but that is suboptimal. Is the default collation wrong?
My Code:
$image_name = 'abc_def.ghi%';
$sql = "CREATE TABLE $image_name(
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
film_name VARCHAR(70) NOT NULL,
...
)";
if(mysqli_query($link, $sql)){
echo "Table of image $image_name created successfully.";
} else{
echo "ERROR: Could not execute $sql. " . mysqli_error($link);
}