RE: [PHP] Count....

From: Date: Wed, 25 Apr 2001 19:42:04 +0000
Subject: RE: [PHP] Count....
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50340@lists.php.net to get a copy of this message
Lookup the mysql_numrows function (think that's the correct spelling, I'm using Oracle now ;-) - and go from there. Put in an if ($count=mysql_numrows($query)) { // put whatever message/form/whatever you want to show the user here } for example, and put that directly below your $query = mysql_query... line. Maybe make it like this instead: if ($count=mysql_numrows($query)) { // put whatever message/form/whatever you want to show the user here } else { while ($row .... etc. I never decided on those elses and elseifs :) Regards, Henning Pedersen Funcom Oslo -----Original Message----- From: Rafael Faria [mailto:rafaelrfc@bol.com.br] Sent: 25. april 2001 21:36 To: php-general@lists.php.net Subject: [PHP] Count.... I'm doing a seach function... everything is ok....but i wanna put something like "Use more specific terms" when the search don't have anything to show..... but i can't do that.... can someone helpme? i'm doing that! ================= $query = mysql_query("select * from Newsletter_Members where Newsletter_Members.email like '%$search%' order by id"); while ($row = mysql_fetch_row($query)) { echo "<tr bgcolor=#DDDDDD>\n"; echo "<td align=center><input type=checkbox name=id[] value=$row[0]></td>\n"; echo "<td align=center><font size=2 face=verdana>&nbsp;$row[0]&nbsp;</font></td>\n"; echo "<td align=center><font size=2 face=verdana>&nbsp;<a href=mailto:$row[1]>$row[1]</a>&nbsp;</font></td>\n"; echo "<td align=center><font size=2 face=verdana><a href=\"javascript:openwin('editmember.php?email=$row[1]&id=$row[0]','adicion ar','400','110')\">Editar</a></font></td>\n"; echo "</tr>\n"; } =================== how can i make if doen't match anything say "it doen't match anything" ? --- [ r a f a e l f a r i a] _____________________ _________________rafaelrfc@uol.com.br WebMaster Universo Online - http://www.uol.com.br Phone # +55 11 3038-8665 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#50340) next »