I think that is what I had to do. I used another select statement:
Here is what I do - maybe someone can show us a faster way to do this - ?
my $sth3 = $dbh->prepare("select MAX(id) from issue")
or bail_out("Cannot Connect");
$sth3->execute;
my @arr=();
while (@arr = $sth3->fetchrow)
{
($theid)=@arr;
$nid=$theid;
}
$sth3->finish;
my $sth4 = $dbh->prepare("select min,title from issue where id=\"$nid\" ")
or bail_out("Cannot Connect");
$sth4->execute;
my @arr=();
while (@arr = $sth4->fetchrow)
{
($min,$title)=@arr;
etc....print $min, $title etc...
}
$sth4->finish;
Ali wrote:
> Hello Douglas,
>
> thanks for your reply. In this case I will select only the last id in the
> table and not the record itself. So I have to write another select statement
> and use this id to get the corresponding record perhaps. Is it possible to
> use such a select statement?
>
> "SELECT * FROM tbl_name WHERE id='MAX(id)'";
>
> Thank you.
>
> Ali
>
> --
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/documentation/manual.php" before
> posting. To request this thread, e-mail mysql-thread56965@stripped
>
> To unsubscribe, send a message to:
> <mysql-unsubscribe-brantzdr=appstate.edu@stripped>
>
> If you have a broken mail client that cannot send a message to
> the above address (Microsoft Outlook), you can use:
> http://lists.mysql.com/php/unsubscribe.php
--
Douglas Brantz
Computer Consultant
Fine & Applied Arts
Appalachian State University
Boone, NC 28608
828-262-6312 FAX
828-262-6549 OFFICE
brantzdr@stripped