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