You are here: empty variable if/then « PHP Programming Language « IT news, forums, messages
empty variable if/then

Posted by Mikey P on 02/28/06 18:26

Hi there, i'm trying to figure out if there is an empty variable in a
search to return an alternative result...

like:

$query = mysql_query("SELECT * FROM db WHERE city='$city2' AND
state='$state2' ORDER BY title");
while($row = mysql_fetch_assoc($query)){
if (empty($url)) {
echo($row['title'] . '<br>');
} else {
echo
echo('<b><a href="' . $row['url'] . '>' . $row['title'] . '</a></b>');
}
}

from what it looks like it seems to be searching and saying if there is
any result that is empty in $url return this result. I guess i need to
know how to say.. if there is an empty $url on this row return this
result if there isn't then return the other. :) hope that makes some
sort of sense... Sorry i'm still fairly new at this.

 

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

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