Re: array syntax in pg_execute call
От | G. J. Walsh |
---|---|
Тема | Re: array syntax in pg_execute call |
Дата | |
Msg-id | 1205389006.8993.7.camel@www.dscdirectionalservices.com обсуждение исходный текст |
Ответ на | Re: array syntax in pg_execute call ("Vyacheslav Kalinin" <vka@mgcp.com>) |
Список | 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'); > } >
В списке pgsql-novice по дате отправления: