我的代码有问题,我想将 $meaning 变量放入我的 di 的 innerhtml 中,这是我的代码:searchinput.php:
<form action = "search.php" method = "post">
<input name="word" id="word" type="text" maxlength="255" />
<label for="word">word:</label></br></br>
<input type="submit" value="search" />
</form>
<div id = "meaning"> </div>
搜索.php:
<?php
$db = mysql_connect("localhost", "root", "");
mysql_select_db("project",$db);
$word = isset($_POST["word"]) ? $_POST["word"] : "";
$result = mysql_query("select meaning from vocabulary where word = '$word'");
$fetchmeaning = mysql_fetch_array($result);
$meaning = $fetchmeaning['meaning'];
?>
现在我想要这个:
document.getElementById('meaning').innerhtml = $meaning; !!!!
我怎么能做到这一点?