July 18th, 2001, 08:40 PM
-
Creating PostgreSQL table
I am attemtping to create a table in my database through a FTP client using Pearl Script. The following is a copy of my script. I saved the file as a text file and placed it in my cgi local directory.
$db=pg_connect("dbname=mydb user=mydb");
SQL-query:
CREATE TABLE members (
id int(11) NOT NULL auto_increment,
fname varchar(25),
lname varchar(25) NOT NULL,
address varchar(100) NOT NULL,
city varchar(25) NOT NULL,
state varchar(25) NOT NULL,
zip int(5) DEFAULT '0' NOT NULL,
phone varchar(15),
)
This script reults in a Premature end of script headers: error. Can anyone tell me how to fix my code.
July 18th, 2001, 09:10 PM
-
One thing that I noticed is that in SQL statements you use commas to seperate a series of items. You don't put a comma after the last item. Your query has a comma after the last field which should be removed.
This:
phone varchar(15),)
Should be:
phone varchar(15))