您好,欢迎访问一九零五行业门户网

《php---mysql简单应用---在线词典》_PHP教程

[html]
insert title here
请输入您要查找的英文单词:
insert title here
请输入您要查找的英文单词:
[php] view plaincopyprint?
conn = mysql_connect($this->host, $this->user, $this->password); 
        if (!$this->conn){ 
            die(连接数据库失败.mysql_error()); 
        } 
        //选择数据库  
        mysql_select_db($this->db,$this->conn); 
        mysql_query(set names utf8); 
    }
function findchword($enword){
$sql = select * from words where enword ='.$enword.'limit 0,10;
$res = mysql_query($sql,$this->conn) or die(mysql_error());
if (!$res){ 
            return 0;//失败  
        }else{
$row = mysql_fetch_assoc($res); 
            return $row['chword']; 
        } 
    }
} conn = mysql_connect($this->host, $this->user, $this->password);
  if (!$this->conn){
   die(连接数据库失败.mysql_error());
  }
  //选择数据库
  mysql_select_db($this->db,$this->conn);
  mysql_query(set names utf8);
 }
 function findchword($enword){
$sql = select * from words where enword ='.$enword.'limit 0,10;
$res = mysql_query($sql,$this->conn) or die(mysql_error());
if (!$res){
   return 0;//失败
  }else{
$row = mysql_fetch_assoc($res);
   return $row['chword'];
  }
 }
}
[php]
findchword($_post['enword']); 
        if ($chword){ 
            echo $_post['enword'].对应的中文意思是:.$chword.

        }else{ 
            echo 未查询到结果!

        } 
    }else{ 
        echo 未获取任何输入!

    } 
        echo 点击返回

findchword($_post['enword']);
  if ($chword){
   echo $_post['enword'].对应的中文意思是:.$chword.
;
  }else{
   echo 未查询到结果!
;
  }
 }else{
  echo 未获取任何输入!
;
 }
  echo 点击返回
;
http://www.bkjia.com/phpjc/477931.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/477931.htmltecharticle[html] !doctype html public -//w3c//dtd html 4.01 transitional//en http://www.w3.org/tr/html4/loose.dtd html head meta http-equiv=content-type content=text/html; charset=utf-8 titl...
其它类似信息

推荐信息