PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 18th, 2001, 08:40 PM
LanceN LanceN is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 1 LanceN User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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");

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.

Reply With Quote
  #2  
Old July 18th, 2001, 09:10 PM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
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))

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Creating PostgreSQL table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT