Re: Last ID Problem

Поиск
Список
Период
Сортировка
От Vishal Kashyap @ [SaiHertz]
Тема Re: Last ID Problem
Дата
Msg-id 77b69d2105013111251fac2451@mail.gmail.com
обсуждение исходный текст
Ответ на Last ID Problem  (<operationsengineer1@yahoo.com>)
Ответы Re: Last ID Problem  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
Hi,

> $id = "SELECT currval('cust_id')"; // used in an
> attempt to get last id (colum 'cust id')entered into
> db.
>
> $result = $db->Execute($sql);  // works fine.
>
> $id_result = $db->execute($id);  // $id_result has no
> value.

This is because currval fetched data during a transaction process and
not after the process  is complete.

the best way I suggest is

 $id = "SELECT cust_id from customer  where customer_name ='$cust'
order by cust_id desc limit1" ; // used in an

--
With Best Regards,
Vishal Kashyap.
Lead Software Developer,
http://saihertz.com,
http://vishalkashyap.tk

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

Предыдущее
От:
Дата:
Сообщение: Last ID Problem
Следующее
От:
Дата:
Сообщение: Re: Last ID Problem