
点击“查询”结果为:
查询没有这个词条
返回重新查询
为什么结果不是:
"输入为空"
返回重新查询呢???
代码为:
if(isset($_POST['enword'])){
$en_word=$_POST['enword'];
}else{
echo "输入为空";
echo "<a href='mainView.php'>返回重新查询</a>";
}
// 看看数据库中有没有这条记录
// 用什么,查询什么
$sql="select chword from words where enword='".$en_word."' limit 0,1";
// 设计表
// 查询(面向对象)
$sqlTool = new SqlTool();
$res=$sqlTool->execute_dql($sql);
if($row=mysql_fetch_assoc($res)){
echo $en_word."--对应的中文意思是:".$row['chword'];
echo "<br/><a href='mainView.php'>返回重新查询</a>";
}else{
echo "查询没有这个词条";
echo "<br/><a href='mainView.php'>返回重新查询</a>";
}
mysql_free_result($res);
请高手指教~~~谢谢先~~~

