任何人都可以告訴我什麼是在這個大壩代碼中的錯誤我瘋狂地搜索有關的錯誤,但沒有任何成功 錯誤是,我沒有從任何數據表爲什麼會發生這種情況? plz幫助我檢索數據並顯示在droplist(php/mysql)
的index.php
<html>
<head>
</head>
<body>
<form action="index.php" method="post">
<label for="searchByCountry">By Country</label>
<select name="searchByCountry" id="searchByCountry">
<option id="0">--select your country--</option>
<?php
require_once('connfor_lamelchameltest.php');
$getallCountries = mysql_query("SELECT country_name FROM country") or die("could not search for countries");
if(mysql_num_rows($getallCountries) > 0) {
while($viewallCountries = mysql_fetch_array($getallCountries)){
?>
<option id="<?php echo $viewallCountries['country_name']; ?> "></option>
<?php } ?>
<?php } ?>
</select>
</form>
</body>
</html>
你得到任何錯誤? – Winston 2013-02-27 13:31:09
你已經試過了什麼?另外,你的數據庫中有什麼?你打電話過得怎麼樣? connfor_lamelchameltest.php裏面有什麼?在這個問題上工作。 – L0j1k 2013-02-27 13:31:37
我試圖從包含country_id和country_name的表格國家調用或檢索數據,連接是由處理配置和連接的** connfor_lamelchameltest.php **進行的 – 2013-02-27 13:34:23