1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Rep Power

    Red face 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");


    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.
  2. #2
  3. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Fly-over country
    Rep Power
    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.


    phone varchar(15),)

    Should be:

    phone varchar(15))

IMN logo majestic logo threadwatch logo seochat tools logo