|
Posted by Rik on 07/17/07 20:58
On Tue, 17 Jul 2007 22:35:34 +0200, gagal <lynettesmith@gmail.com> wrote:
> How do I get it to display None only once? Now it displays the word
> for each record. Everything else works.
>
Option 1. Preferred:
Use mysql_num_rows() on a query allready returning the valid dates as
indicated earlier, and return out of the function before fetching
non-existent data.
Option 2. Damage control without to much rewrites (not recommended):
Set a boolean variable to false in the beginning, and set it to true (in
this case every time) when a match is found. Move you 'None'-display
outside of the loop, and only display it if your boolean is still false.
Seriously consider letting the database handle matching birthdays, you're
fetching a way to big resultset from your database.
--
Rik Wasmus
[Back to original message]
|