非常简单的下拉列表...... [英] very simple drop-down list...
问题描述
嗨!我有一个非常简单的下拉列表的问题,因为
页面在下拉列表中没有元素但没有给出任何错误。
这个是代码:
< form name =" year_search_form"方法= QUOT;交" action =" results.php">
< select name =" select_year" id =" select_year">
< ;?
$ query =" SELECT * FROM table ORDER BY year";
$ result = mysql_query($ query)或die(查询中的错误:$ query。
..mysql_error());
while( $ line = mysql_fetch_array($ result)){
print("< OPTION value ="。$ line [''year'']。">< / OPTION>" ); }
?>
< / select>
< / form>
与DB的连接已建立并正常工作..
感谢您的帮助!!
query =" SELECT * FROM table ORDER BY year" ;;
result = mysql_query(
query)或die("查询错误:
Hi! I''m having a problem with a very simple drop-down list since the
page comes out with no elements in the drop-down but giving no errors.
This is the code:
<form name="year_search_form" method="post" action="results.php">
<select name="select_year" id="select_year">
<?
$query="SELECT * FROM table ORDER BY year";
$result = mysql_query($query) or die ("Error in query: $query. "
..mysql_error());
while ($line = mysql_fetch_array($result)) {
print ("<OPTION value=".$line[''year'']."></OPTION>"); }
?>
</select>
</form>
The connection with the DB is established and working..
Thanks for your help!!
query="SELECT * FROM table ORDER BY year";
result = mysql_query(
query) or die ("Error in query:
这篇关于非常简单的下拉列表......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!