List:General Discussion« Previous MessageNext Message »
From:Douglas Brantz Date:November 21 2000 8:35pm
Subject:Re: select statement
View as plain text  
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


Thread
select statementAli21 Nov
  • Re: select statementDouglas Brantz21 Nov
  • Re: select statementAli21 Nov
  • Re: select statementDavid Moore21 Nov
    • Searching for a whole wordFrancisco Javier Lozano Bastidas21 Nov
      • Re: [PHP-DB] Searching for a whole wordJamie Alessio21 Nov
        • Re: [PHP-DB] Searching for a whole wordFrancisco Javier Lozano Bastidas21 Nov
    • database name can be too longJerry & Ellen Davis21 Nov
      • SPAM: Job OppDave Cross21 Nov
  • Re: select statementDouglas Brantz21 Nov
Re: Searching for a whole wordBob Hall22 Nov