Re: createdb from the web

From: Date: Fri, 24 Nov 2000 23:17:47 +0000
Subject: Re: createdb from the web
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-4731@lists.php.net to get a copy of this message
I think u have to connect as postgres in this case for example try $db = pg_Connect( "host=localhost dbname=template1 user=postgres password=urpostgresspasswd" ); or u have to create a user with dbcreate permission then connect with that user to template1 then issue the create database command then disconnect and reconnect using the user and the new db I will try this tomorow and tell u the exact steps ----- Original Message ----- From: Matrix 01 <thematrix01@email.com> To: <php-db@lists.php.net> Sent: Saturday, November 25, 2000 1:25 AM Subject: [PHP-DB] createdb from the web I am trying to create a database by running a php script from a webpage. I have tried shell_exec(createdb Address) but it doesn't do anything and the only way I can see of creating the database is by connecting to a different database. Unfortunately my script still doesn't work and returns permission denied Please can you guide me how to do it properly: <HTML> <BODY> <?PHP // Connect to PostgreSQL. // $db = pg_Connect( "host=localhost dbname=forms" ); if( !$db ) { echo "Could not connect!"; exit; } $query = "CREATE DATABASE Address"; $result = pg_Exec( $db, $query ); if( !$result ) { echo "No Database created!"; exit; } ?> <H3>Database created!</H3> </BODY> </HTML> Thanks ----------------------------------------------- FREE! The World's Best Email Address @email.com Reserve your name now at http://www.email.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#4731) next »