Re: array syntax in pg_execute call

From: "G(dot) J(dot) Walsh" <gjwalsh(at)dscdirectionalservices(dot)com>
To: Vyacheslav Kalinin <vka(at)mgcp(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: array syntax in pg_execute call
Date: 2008-03-13 06:16:46
Message-ID: 1205389006.8993.7.camel@www.dscdirectionalservices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I'm guilty of some careless typing. Sorry. I was trying to simplify
things for the email only and made a bad matter worse.

The testcode is the primary key for all tables and should have been
shown as character(10), not char[10].

And yes, there is a comma missing after the closing } of the second
array, but not in the actual code.

Thanks very much for the tip about properly displaying the errors
though. I will try to learn from that tomorrow when I have gained some
needed sleep.

My thanks for the help.

George

On Thu, 2008-03-13 at 04:34 +0300, Vyacheslav Kalinin wrote:
> >
> 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

Browse pgsql-novice by date

  From Date Subject
Next Message Manolo 2008-03-13 11:25:53 Sorting Tuples
Previous Message Vyacheslav Kalinin 2008-03-13 01:34:20 Re: array syntax in pg_execute call