Re: array syntax in pg_execute call - Mailing list pgsql-novice

From Vyacheslav Kalinin
Subject Re: array syntax in pg_execute call
Date
Msg-id 9b1af80e0803121834v1124e2c9i4e4c3e73026ad8e9@mail.gmail.com
Whole thread Raw
In response to array syntax in pg_execute call  ("G. J. Walsh" <gjwalsh@dscdirectionalservices.com>)
Responses Re: array syntax in pg_execute call  ("G. J. Walsh" <gjwalsh@dscdirectionalservices.com>)
List pgsql-novice
> pg_execute($pg,"initbadtest",array(testcode,'{0,0,0,0,0,0}','{0,0,0,0,0,0}));
Apparently there's missing quote here and what is testcode? Should it be 'testcode' or $testcode or maybe it is defined constant? Anyway, if you provided correct table definition your testcode column is declared as array of char (char(1) to be exact) - CHAR[10] which might be the reason. As for error messages - PHP emits warnings on query failure so you have to adjust error_reporting level appropriately to see them, you can also handle errors in your code for example like this:
$result = pg_execute(...);
if ($result === false) {
    print pg_last_error();
    die('Query failed');
}

pgsql-novice by date:

Previous
From: "G. J. Walsh"
Date:
Subject: array syntax in pg_execute call
Next
From: "G. J. Walsh"
Date:
Subject: Re: array syntax in pg_execute call