Re: Is While needed in MySQL Result with a Limit of 1
| From: | Alexander Skwar | Date: | Wed, 10 Apr 2002 15:50:02 +0000 |
| Subject: | Re: Is While needed in MySQL Result with a Limit of 1 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92409@lists.php.net to get a copy of this message | ||
»Brian Drexler« sagte am 2002-04-10 um 07:58:59 -0400 :
> My question is this....is the while statement needed when I'm only returning
> one record?
No, it's not. Since you know that you'll either get 0 or 1 row, you
don't need the while loop. Instead I'd call mysql_num_rows to see if
there was 1 row.
Alexander Skwar
--
How to quote: http://learn.to/quote (german) http://quote.6x.to (english)
Homepage: http://www.iso-top.de | Jabber:
askwar@charente.de
iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 21 hours 45 minutes