checking mechanism
| From: | Russ Michell | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | checking mechanism | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-9520@lists.php.net to get a copy of this message | ||
Hi all:
I have a simple checking mechanism:
$num = mysql_num_rows($result);
if($num == 0) {
$display_news = "<p>Sorry, no news items.</p>";
}
else {
while(this, that and the other) {
}
}
What's the difference between:
if($num == 0) {
$display_news = "<p>Sorry, no news items.</p>";
}
//and:
if($num != 1) {
$display_news = "<p>Sorry, no news items.</p>";
}
As I seem to remember the former working fine...now I have to switch to
the latter???
Cheers.
Russ
#-------------------------------------------------------#
"Believe nothing - consider everything"
Russ Michell
Anglia Polytechnic University Webteam
e: r.j.michell@apu.ac.uk
w: www.apu.ac.uk/webteam
t: +44 (0)1223 363271 x 2331
www.theruss.com
#-------------------------------------------------------#