8 messages in com.mysql.lists.perlmysql_insertid not working!!!
FromSent OnAttachments
atif29 Mar 2004 06:33 
Rudy Lippan29 Mar 2004 06:54 
atif29 Mar 2004 21:44 
David Dick29 Mar 2004 22:04 
atif29 Mar 2004 22:18 
atif29 Mar 2004 22:21 
David Dick30 Mar 2004 01:20 
atif30 Mar 2004 05:41 
Subject:mysql_insertid not working!!!
From:atif (at@convergence.com.pk)
Date:03/29/2004 06:33:32 AM
List:com.mysql.lists.perl

hello every body!!!

I want to fetch the rowid/rowcount when I insert some data in the table; I mean
the row# where data has been inserted

I have tried all of these after connecting the data base... here is my code.....

use DBI; use DBD::mysql;

$dbh=$DBI->connect("DBI:mysql:database=asteriskvmusers:localhost","root","vmuser");

$rth=$dbh->prepare("insert into users () values('test','1037','4366','test2
test2','tes@test2.com','','','')"); $rth->execute();

$row_id1 = $rth->{mysql_insertid};**

$rth->finish();

**I have also tried $rth->{'mysql_insertid'} but it always returns 0 (zero)

please smbdy sort it out

Thankyou