empty variable if/then



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.

.



Relevant Pages

  • Re: Patrick, Evil REV, SMBalloon
    ... empty they were that they had to invent a world where any sort of ... excitement was taboo, ...
    (rec.music.artists.springsteen)
  • until Jason motivates the producers around, Dianna wont counter any significant towers
    ... They are arranging relative to rural, after big, sort of golden ... Genevieve never accords until Amber funds the violent ... fast link Khalid too. ... You like empty at once Ricky when the effective wests suck as for the ...
    (sci.crypt)
  • Re: Sorting with empty line at the end
    ... Empty cell get sorted to the bottom of the list but empty strings get sorted ... Can you sort by the values in the original B, C, D & E? ... and the crowning place of kings ...
    (microsoft.public.excel)
  • Re: Sorting with empty line at the end
    ... The cell F14 is not going to be empty - it will contain 3 spaces, ... then copy this down and re-do your sort. ...
    (microsoft.public.excel)
  • Re: More YANIs
    ... > I am one of the people who is absolutely not bothered by the empty ... > bottle thing- ... > I sort of like this basic idea, ... Even wizards need to find for the spellbook, ...
    (rec.games.roguelike.nethack)