Re: [PHP-DB] Copy table to file inside PHP

2001-02-05 Thread Brian C. Doyle

The userid needs to be your DB Super User (ie allowed to create db's)

At 11:15 AM 2/5/01 -0500, Brian C. Doyle wrote:
>What is the error you get?
>
>To do the Copy you need to specify a userid in your pg_connect like
>$conn = pg_connect ("host=localhost port=5432 user=userid dbname=dbname");
>
>That should take care of it.  It did for me!
>
>At 12:02 AM 2/6/01 +0900, Achmad Gutomo wrote:
>>Hi PHP Gurus !
>>
>>Anyone have idea to copy table to file from the web?
>>
>> From the unix shell we can do :
>>
>>COPY table_name TO '/home/someone/table_name.dat' ;
>>
>>I tried inside PHP
>>
>>$con=pg_connect("","","","",dbname);
>>$result=pg_exec($con,"COPY table_name TO '/home/someone/table_name.dat'");
>>pg_close($con);
>>
>>but got error.
>>I use Apache+PHP+PostgreSQL on Redhat7
>>
>>Any suggestion for me ?
>>Thank for your help !
>>
>>GTM
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Copy table to file inside PHP

2001-02-05 Thread Brian C. Doyle

What is the error you get?

To do the Copy you need to specify a userid in your pg_connect like
$conn = pg_connect ("host=localhost port=5432 user=userid dbname=dbname");

That should take care of it.  It did for me!

At 12:02 AM 2/6/01 +0900, Achmad Gutomo wrote:
>Hi PHP Gurus !
>
>Anyone have idea to copy table to file from the web?
>
> From the unix shell we can do :
>
>COPY table_name TO '/home/someone/table_name.dat' ;
>
>I tried inside PHP
>
>$con=pg_connect("","","","",dbname);
>$result=pg_exec($con,"COPY table_name TO '/home/someone/table_name.dat'");
>pg_close($con);
>
>but got error.
>I use Apache+PHP+PostgreSQL on Redhat7
>
>Any suggestion for me ?
>Thank for your help !
>
>GTM


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Copy table to file inside PHP

2001-02-05 Thread Achmad Gutomo
Hi PHP Gurus !

Anyone have idea to copy table to file from the web?

>From the unix shell we can do :

COPY table_name TO '/home/someone/table_name.dat' ;

I tried inside PHP

$con=pg_connect("","","","",dbname);
$result=pg_exec($con,"COPY table_name TO '/home/someone/table_name.dat'");
pg_close($con);

but got error.
I use Apache+PHP+PostgreSQL on Redhat7

Any suggestion for me ?
Thank for your help !

GTM