Re: Error

Поиск
Список
Период
Сортировка
От Charley Tiggs
Тема Re: Error
Дата
Msg-id 9BAEF2AE-0B0D-42A1-AD6B-0CAF4383CED7@xpressdocs.com
обсуждение исходный текст
Ответ на Re: Error  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
On Nov 30, 2005, at 7:12 PM, <operationsengineer1@yahoo.com>
<operationsengineer1@yahoo.com> wrote:

>> What's the value of $customer_id before you attempt
>> the insert?
>>
>> right after $customer_id variable is set, do the
>> following:
>>
>> echo $customer_id . '<br />';
>> echo gettype ( $customer_id );
>> exit;
>>
>> With ADO, a couple of times, I've run into a glitch
>> where bindings
>> changed types.  Haven't taken the time to figure out
>> why.  Switching
>> to autoExecute solves the problem:
>>
>> $insert_array = array ( 'customer_id' =>
>> $db->getone("select nextval
>> ('t_customer_cust_id_seq')"),
>>                     'customer_name' =>
>> $form->GetInputValue('customer_name'),
>>                     'customer_entry_date' => $db->DBDate(time()))
>>
>> $result = $db->autoExecute ( 't_customer',
>>                             $insert_array,
>>                             'INSERT' );
>>
>> Most likely, the reason it works for me is that I
>> cleaned up my error
>> when switching to the autoExecute method.
>>
>> Charley
>
> using php to cast to to an integer...
>
> $customer_id = (int) $customer_id;
>
> ...worked for me.  i have a note in on the adodb forum
> to find out why it is casting as boolean.

I think your query failed.

After you execute this query:

>> $customer_id = $db->getone("select nextval
>> ('t_customer_cust_id_seq')");

do the following:

echo $db->ErrorMsg();
exit;

That will tell you why the query failed.

Charley

В списке pgsql-novice по дате отправления:

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: child fk problem
Следующее
От:
Дата:
Сообщение: Re: Error