I have this script:
As you can tell that is supposed to create 2 tables, users and news.PHP Code:<?php
include('../includes/db.php');
echo('<p>This page will attempt to create the MySQL Tables for you.<br />');
$userstable = 'CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username TEXT,
password TEXT,
registerdate DATE NOT NULL,
admin TEXT,
author TEXT
)';
if (@mysql_query($usertable)) {
echo 'User table successfully created!<br />';
} else {
exit('Error creating the User table: ' .
mysql_error() . '<br />Please use your database management application to add this to your database:<br />
<textarea>CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username TEXT,
password TEXT,
registerdate DATE NOT NULL,
admin TEXT,
author TEXT
)</textarea><br />');
}
$newstable = 'CREATE TABLE news (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
author TEXT,
date DATE NOT NULL,
newstext TEXT,
category TEXT,
)';
if (@mysql_query($newstable)) {
echo 'News table successfully created!<br />';
} else {
exit('Error creating the News table: ' .
mysql_error() . '<br />Please use your database management application to add this to your database:<br />
<textarea>CREATE TABLE news (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
author TEXT,
date DATE NOT NULL,
newstext TEXT,
category TEXT</textarea><br />');
}
if (@mysql_query($usertable, $newstable)) {
header("Location: install2.php");
}
?>
when I run it, I get:
This page will attempt to create the MySQL Tables for you.
Error creating the User table: Query was empty
Please use your database management application to add this to your database:
How can the query be empty? when it clearly has stuf in it...
Does anyone see what I did wrong?
Thanks,







Bookmarks