Reputation: 544
I want to create a table in MySQL with the name "123 Product", with numbers at the beginning and a space in between. I can do this using phpMyAdmin but I want to make this table using PHP. But, unfortunately, I am unable to do this.
Upvotes: 7
Views: 10946
Reputation:
You can simply try this: enclose table name with backticks (`)
CREATE TABLE `123 Product`
(
`product_id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`product_name` VARCHAR(255) NOT NULL
)
ENGINE = InnoDB;
Upvotes: 16