SQL syntax error

apps

#1

I would like to use a php script called phpHoo for a directory database. However, I’m getting a syntax error when I try to install the database through phpmyadmin.

Does anyone have any ideas?


Error

SQL-query :

CREATE DATABASE phpHoo USE phpHoo CREATE TABLE Categories(
CatID bigint( 21 ) NOT NULL AUTO_INCREMENT ,
CatName varchar( 32 ) NOT NULL ,
CatParent bigint( 21 ) ,
PRIMARY KEY ( CatID ) ,
UNIQUE (
CatName
)
) CREATE TABLE Links(
LinkID bigint( 21 ) NOT NULL AUTO_INCREMENT ,
CatID bigint( 21 ) NOT NULL ,
Url varchar( 255 ) NOT NULL ,
LinkName varchar( 64 ) NOT NULL ,
Description varchar( 255 ) NOT NULL ,
Approved tinyint( 8 ) DEFAULT ‘0’,
SubmitName varchar( 64 ) NOT NULL ,
SubmitEmail varchar( 64 ) NOT NULL ,
SubmitDate bigint( 21 ) NOT NULL ,
PRIMARY KEY ( LinkID ) ,
UNIQUE (
Url
)
) \ p \ g SHOW COLUMNS FROM Categories \ p \ g SHOW COLUMNS FROM Links \ p \ g

MySQL said:

You have an error in your SQL syntax near ‘USE phpHoo CREATE TABLE Categories( CatID bigint( 21 ) NOT NULL AUTO_INCREM’ at line 1


#2

Try this:-

CREATE DATABASE phpHoo;

USE phpHoo;

CREATE TABLE Categories (
CatID bigint( 21 ) NOT NULL AUTO_INCREMENT ,
CatName varchar( 32 ) NOT NULL ,
CatParent bigint( 21 ) ,
PRIMARY KEY ( CatID ) ,
UNIQUE (
CatName
)
);

CREATE TABLE Links (
LinkID bigint( 21 ) NOT NULL AUTO_INCREMENT ,
CatID bigint( 21 ) NOT NULL ,
Url varchar( 255 ) NOT NULL ,
LinkName varchar( 64 ) NOT NULL ,
Description varchar( 255 ) NOT NULL ,
Approved tinyint( 8 ) DEFAULT ‘0’,
SubmitName varchar( 64 ) NOT NULL ,
SubmitEmail varchar( 64 ) NOT NULL ,
SubmitDate bigint( 21 ) NOT NULL ,
PRIMARY KEY ( LinkID ) ,
UNIQUE (
Url
)
);

I have no idea what

\ p \ g SHOW COLUMNS FROM Categories \ p \ g SHOW COLUMNS FROM Links \ p \ g

Does… but that was throwing up an error so i removed it.

www.rawkstar.net


#3

I ended up entering it through phpMyAdmin interface, and it worked.