这是我的PHP代码,我正在尝试向自动完成搜索添加滚动条,我已从数据库中检索数据并想要添加滚动条。:
<?php
include('connection.php');
$result1 = mysql_query("select * from legal_pashto");
$result2 = mysql_query("select * from legal_dari");
$result3 = mysql_query("select * from pashto_pashto");
$result4 = mysql_query("select * from dari_pashto");
?>
<datalist id="words">
<?php while($row = mysql_fetch_assoc($result1)){?>
<option value="<?php print $row['english_word']; ?>
<option value="<?php print $row['pashto_word']; ?>
<option value="<?php print $row['pashto_word1']; ?>
<option value="<?php print $row['pashto_word2']; ?>
<option value="<?php print $row['pashto_word3']; ?>
<option value="<?php print $row['pashto_word4']; ?>
<?php }?>
<?php while($row2 = mysql_fetch_assoc($result2)){?>
<option value="<?php print $row2['english_word']; ?>
<option value="<?php print $row2['dari_word']; ?>
<option value="<?php print $row2['dari_word1']; ?>
<option value="<?php print $row2['dari_word2']; ?>
<option value="<?php print $row2['dari_word3']; ?>
<option value="<?php print $row2['dari_word4']; ?>
<?php }?>
<?php while($row3 = mysql_fetch_assoc($result3)){?>
<option value="<?php print $row3['pashto_word']; ?>
<option value="<?php print $row3['pashto_meaning']; ?>
<option value="<?php print $row3['pashto_meaning1']; ?>
<option value="<?php print $row3['pashto_meaning2']; ?>
<option value="<?php print $row3['pashto_meaning3']; ?>
<option value="<?php print $row3['pashto_meaning4']; ?>
<?php }?>
<?php while($row4 = mysql_fetch_assoc($result4)){?>
<option value="<?php print $row4['dariword']; ?>
<option value="<?php print $row4['darimeaning']; ?>
<option value="<?php print $row4['darimeaning1']; ?>
<option value="<?php print $row4['darimeaning2']; ?>
<option value="<?php print $row4['darimeaning3']; ?>
<option value="<?php print $row4['darimeaning4']; ?>
<?php }?>
</datalist>
答案 0 :(得分:-1)
对于HTML,我不是很好,但在我看来,添加PHP代码可能有助于其他人帮助你。只是说。