I know this is a pretty silly Question but I'll ask it anyway.
I want to create multiple tables from the one php script and all the stuff i've found relates to creating tables from the mySQl command line. This is the php script(as you can imagine it doesnt add any tables to MySQl)
<?
$user="xxxx";
$password="xxxx";
$database="xxxx";
mysql_connect(localhost,$xxxx,$xxxx);
@mysql_select_db($database) or die( "Unable to select database");
"create table customers(customerid int unsigned not null auto_increment primary key,
name char(30) not null,
address char(40) not null,
city char(20) not null)";
"create table orders(orderid int unsigned not null auto_increment primary key,
customerid int unsigned not null,
amount float(6,2),
date date not null
)";
"create table books(isbn char(13) not null primary key,
author char(30),
title char(60),
price float(4,2)
)";
"create table order_items(orderid int unsigned not null,
isbn char(13) not null,
quantity tinyint unsigned,
primary key (orderid, isbn)
)";
"create table book_reviews(isbn char(13) not null primary key,
review text
)";
mysql_close();
?>
Now I know I need to use mysql_query() and assign variable for the tables. But previously I assigned them all to $query, ie $query="create table------" for each table and used mysql_query($query). But only one of the tables was added to the database even though all were assigned.
How do assign them to a variable and get them added to mySQl in 1 go.