Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional PHP6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional PHP6
This is the forum to discuss the Wrox book Professional PHP6 by Edward Lecky-Thompson, Steven Nowicki; ISBN: 9780470395097
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional PHP6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 23rd, 2010, 07:59 PM
Authorized User
Points: 152, Level: 3
Points: 152, Level: 3 Points: 152, Level: 3 Points: 152, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2010
Location: Bra - Italy
Posts: 36
Thanks: 1
Thanked 1 Time in 1 Post
Default Connection with PostgreSQL

Hello (sorry for the english but i'm italian)
I've some problem with the connection with a database of PostgreSQL because i don't know the correct syntax, i try this code:
Code:
<?php
$db = pg_pconnect("host=localhost port=5432 dbname=postgres user=postgres password=pass");

$sql = 'CREATE TABLE "widget" (
	"widgetid" SERIAL PRIMARY KEY NOT NULL,
	"name" varchar(255) NOT NULL,
	"description" text
	)';
	
pg_query($db, $sql) or die ("unable to create table");

echo 'success';
?>
The result is an HTTP Error 500, php and apache are correctly configured, i can try all the php functions, but i don't know the correct configuration php-postgresql. With a phpinfo i see a field named "mysqlnd", but i've only install postgresql and never mysql or others.. can you help me please? Thanks a lot.
Reply With Quote
  #2 (permalink)  
Old April 1st, 2011, 12:25 AM
Registered User
 
Join Date: Mar 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Smile user: postgresm , password:pass can Permissions to CREATE TABLE

1: make sure your user: postgresm AND password:pass
can Permissions to CREATE TABLE

2:you can write one.php to link database can sure is good
and then to write two.php to write somethig from database

and three.php to insert data into database

you can Step by step to win
Reply With Quote
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with change postgreSQL connection to MySQL chadneiro PHP How-To 2 July 7th, 2010 12:37 PM
Postgresql Transactions satyr Pro JSP 0 March 23rd, 2006 07:31 AM
question regarding PostgreSQL Moharo MySQL 2 September 9th, 2003 02:38 AM
Upgrading Postgresql 7.1.3 to 7.3.3 ganesh15 PHP How-To 1 September 3rd, 2003 11:07 PM



All times are GMT -4. The time now is 12:19 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.