I have a mysql query that I need to echo a variable from "once" before I go
into the while loop which would list the entire contents of the array. The
field shown once will not be displayed in the while looped contents. So
theoretically, something like this:

$result = mysql_query("SELECT h.title, a.agentname, a.agenturl,
IF(h.status='Sold',1,0) AS is_sold FROM homes h, agents a WHERE h.owner=a.id
AND a.id=$aid ORDER BY is_sold ASC");

if ($is_sold=="1") {
echo $agentname." ".$agenturl;
}

while ($row=mysql_fetch_array($result)) {
extract($row);
echo $title."<br>";
}

Currently, I have everything in the while loop which prints things out more
than what I'd like. Is there a way that I can get around this problem?

Any suggestions are greatly appreciated thanks. :)

__________________
Jason Dulberg
Extreme MTB
http://extreme.nas.net


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to