You are here: Re: if, else « PHP Language « IT news, forums, messages
Re: if, else

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация