You need a bit better error checking. Always verify that a result is a resource identifier before passing to mysql_fetch_array(). The problem is more than likely you have not established a connection, and so mysql_query() is not executing anything, even if the SQL is correct.
Try:
$query='select * from url_types order by type asc';
if (! $result=mysql_query($query)) {
echo mysql_error();
}
else {
while($row=mysql_fetch_array($result)) {
echo '<option value="', $row[0], '">' , stripslashes($row[1]), '</option>';
}
}
to get a little better error reporting...
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com