It's b/c the globals in 4.0.4pl1 are not working, at least that's why mine
broke. Try replacing the globals in the function with the actual variable
declarations and see if the problem goes away. If not, I guess it's a
different problem, but that fixed it for me.
-----------------------------------------------------------------
Jonathan Rosenberg
Be fierce, be fabulous, change the world!
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 15, 2001 3:21 PM
Subject: [PHP] 4.0.4 Postgres link resource bug?
> Hi,
>
> I have a script that worked up until I upgraded the server from PHP
> 4.0.2 to 4.0.4. I get:
>
> 1 is not a valid PostgreSQL link resource. Why is this broken all of
> a sudden? here is some code:
>
> function SQLCall($call){
> global $psqlhost, $psqldb, $rows, $result;
> $db_connect=pg_connect("host=$psqlhost
> dbname=$psqldb");
> $result=pg_exec($db_connect, "$call");
> $rows=pg_numrows($result);
> }
>
> $call="insert into agents (fname, lname, address, city, state,
> zip, email,
> country, homephone, workphone, company, username, password,
> created, visits, fax, status,
> pridomain, title) values ('$fname', '$lname', '$address', '$city',
> '$bizstate',
> '$zip', '$email', '$country', '$homephone', '$workphone', '$company',
> '$username',
> '$cryptpass', '$created', $visits, '$fax', '$status', '$pridomain',
> '$title')";
> SQLCall($call);
> include("results/newagent.php");
>
> This (bug?) seems to only affect INSERT calls to pg_sql. The
> functions within the script which use UPDATE sql calls (using the
> same SQLCall($call) function in this script work fine.
>
> Any ideas?
>
> Thanks,
>
> Kris
>
> --
> PHP General 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 General 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]