This topic is locked

Code Problem Postgres after building project

8/20/2007 6:13:50 AM
PHPRunner General questions
R
robby author

Tried to build a project using PostgreSQL.

After starting the site I got the following message:
Fatal error: Call to undefined function pg_escape_string() in E:\MyProject\include\dbcommon.php on line 14
14) $connstr= "host='".pg_escape_string($host).

"' user='".pg_escape_string($user).

"' password='".pg_escape_string($password).

"' dbname='".pg_escape_string($dbname).

"' ".$options;
I am using Version 4.1 (Build 291)
Any ideas ?
Regards Robert

J
Jane 8/20/2007

Robert,
it seems that you use PHP 4.2 or older.

PHPRunner-created pages work correctly with PHP 4.3 and later.

R
robby author 8/20/2007

Robert,

it seems that you use PHP 4.2 or older.

PHPRunner-created pages work correctly with PHP 4.3 and later.


I am using XAMP 1.4.14 for windows for the apache server. The PHP version is 5.0.4

The PostreSQL Database is running under Suse Linux.

The connection to the database and tables is working fine in PHPrunner. I also can

generate the complete project and output files.
The running script cannot find the function pg_escape_string. Where does the function come from ?

Sergey Kornilov admin 8/20/2007

This is a standard PHP function:

http://us2.php.net/pg_escape_string
Make sure PostgreSQL support is turned on in PHP:

http://us2.php.net/manual/en/ref.pgsql.php