Hi Vern,

Vern wrote:

I'm trying to write data to a file from a Postgres database using the
following code

    while (!$rsITEMS->EOF) {
       $fp = fopen("./dump.sql", "w");
       fwrite($fp, "$rsITEMS->Fields('item_id')\n");
    $rsITEMS->MoveNext();
> [shortened]

I wouldn't do, if I were you.
It doesn't work, right?

try:
$fp = fopen("dump.sql", "w"); /* make shure, you have the w-bit set on dir for the user who runs php */
if($fp)
{
while(!$rsITEMS->EOF)
{
fwrite($fp, $rsITEMS->Fields('item_id')."\n");
$rsITEMS->MoveNext();
}
fclose($fp);
}else
die("EXCPETION fopen(w)");


does it help?

riese

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to