Montagna, Dan wrote:

I've got the code for a drop down list and the drop down box displays--but
with no info in it. The underlying table is populated so I could use some
advice on what might be wrong from here....
<SELECT>
<?
include("includes/db.php");
MYSQL_CONNECT(HOST,USER,PASS) OR DIE("Unable to connect to database"); @mysql_select_db(DB) or die( "Unable to select database");
$query=("select * from community order by community");
$result=mysql_query($query) or die ("Unable to Make the Query:" .
mysql_error() ); while($row=mysql_fetch_array($result)){

Try a print_r($row) here to see what's being retrieved from the result set.


echo "<OPTION VALUE=".$row['community']."</OPTION>";
}
?>
</SELECT>
Any ideas?

If you view the HTML source of the page, do you see a bunch of empty <option> elements? If so, then $row['community'] isn't valid. Maybe it's a case issue and you should be using $row['Community']? Can't tell because you're using "SELECT *", though...


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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



Reply via email to