Re: array syntax in pg_execute call

Поиск
Список
Период
Сортировка
От Vyacheslav Kalinin
Тема Re: array syntax in pg_execute call
Дата
Msg-id 9b1af80e0803121834v1124e2c9i4e4c3e73026ad8e9@mail.gmail.com
обсуждение исходный текст
Ответ на array syntax in pg_execute call  ("G. J. Walsh" <gjwalsh@dscdirectionalservices.com>)
Ответы Re: array syntax in pg_execute call  ("G. J. Walsh" <gjwalsh@dscdirectionalservices.com>)
Список 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 по дате отправления:

Предыдущее
От: "G. J. Walsh"
Дата:
Сообщение: array syntax in pg_execute call
Следующее
От: "G. J. Walsh"
Дата:
Сообщение: Re: array syntax in pg_execute call