调用mysqli函数出现有关问题,已经配置好环境

WBOY
Release: 2016-06-13 10:56:57
Original
922 people have browsed it

调用mysqli函数出现问题,已经配置好环境
 $mysqli=new mysqli("localhost","root","12345","student");
 $query="select * from person";
 $result=$mysqli->query("$query");
 if($result){
  while($obj=$result->fetch_object()){
  var_dump($obj);echo "
\n";
   
  }}else{
  echo "查询失败";
  }
  $result->free();
  $mysqli->close();
 
?>

------解决方案--------------------
把错误输出看看

PHP code
if($result=$mysqli->query(......)) {//。。。。}else  {    echo $mysqli->error;//把错误输出看看}<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!