Last ID Problem

Поиск
Список
Период
Сортировка
От
Тема Last ID Problem
Дата
Msg-id 20050131191358.22644.qmail@web52405.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Last ID Problem  ("Vishal Kashyap @ [SaiHertz]" <vishalonlist@gmail.com>)
Re: Last ID Problem  (Mitch Pirtle <mitch.pirtle@gmail.com>)
Список pgsql-novice
i'm setting up a data entry entry form.  once the data
is entered in a pgsql, i want to have it redisplay the
blank form with the text just entered displayed.

I have it so it enters data.  i'm having a problem
with permissions so i have to use the database creator
and owner to access the db.

i'm using adodb and the following code to interact
with my db...

-----------------------

$cust = $_POST['cust']; // data entered
$cust = addslashes($cust); // take care of slashes

$db = &ADONewConnection('postgres');
$db -> Connect($db_string,$db_owner,$db_pw,$db_name);

$sql = "INSERT INTO customer (customer_name) VALUES
('$cust')"; // query to insert data - works fine.

$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.

------------------------------

does anyone know how i can structure this so that i
get the last 'cust_id' entered so that i can then use
that id to display the data just entered?

tia...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Re: How to learn Postgres?
Следующее
От: "Vishal Kashyap @ [SaiHertz]"
Дата:
Сообщение: Re: Last ID Problem