You can't just dump a MySQL query into the middle of PHP like that and expect it to work.
You need to wrap some quotes around it and pass it to the mysql_query function.
Replace:
CREATE TABLE useronline
( timestamp int(15) DEFAULT '0' NOT NULL,
ip varchar(40) NOT NULL,
file varchar(100) NOT NULL,
PRIMARY KEY (timestamp),
KEY ip (ip),
KEY file (file)
);
with:
$query = "CREATE TABLE useronline ( timestamp int(15) DEFAULT '0' NOT NULL, ip varchar(40) NOT NULL, file varchar(100) NOT NULL, PRIMARY KEY (timestamp), KEY ip (ip), KEY file (file));";
mysql_query($query);
I'd also recommend a little reading on PHP + MySQL from http://php.net/manual/en/ref.mysql.php
|