0

i want to create a table in sql database using php code.
if i try to use the sql command(given below) in my php source code

"CREATE TABLE new_table(
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
id1 VARCHAR(55) NOT NULL
id2 VARCHAR(32) NOT NULL,
id3 CHAR,
PRIMARY KEY(id));"

i get syntax error ....
and with another code (below)

$sql = 'CREATE TABLE `database_name`.`new_table` (`ds` VARCHAR(2) NOT NULL) ENGINE = InnoDB';

it does'nt do anythng.....it does'nt add a new table....
where am i making the mistake......plzz help

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by langsor
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.