Skip site navigation (1) Skip section navigation (2)

Re: array syntax in pg_execute call

From: "Vyacheslav Kalinin" <vka(at)mgcp(dot)com>
To: "G(dot) J(dot) Walsh" <gjwalsh(at)dscdirectionalservices(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: array syntax in pg_execute call
Date: 2008-03-13 01:34:20
Message-ID: 9b1af80e0803121834v1124e2c9i4e4c3e73026ad8e9@mail.gmail.com (view raw or flat)
Thread:
Lists: 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');
}

In response to

Responses

pgsql-novice by date

Next:From: G. J. WalshDate: 2008-03-13 06:16:46
Subject: Re: array syntax in pg_execute call
Previous:From: G. J. WalshDate: 2008-03-13 00:23:46
Subject: array syntax in pg_execute call

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group