mysql_insertid not working!!!

mysql_insertid not working!!!

am 29.03.2004 16:33:54 von atif

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:local host","root","vmuser");

$rth=$dbh->prepare("insert into users () values('test','1037','4366','test2 test2','test2@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


--
Atif Rasheed
Convergence (Business Systems)
http://www.convergence.com.pk
--

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org