duanqian9503
2015-06-23 11:16
浏览 40
已采纳

mysqli_fetch_array()期望参数1为mysqli_result,第37行给出布尔值

/* * Slenderman * Connect to database * @ return bool (connection) */ function db_connect(){

$connection = ysqli_connect("localhost","slenderman","slenderman");
if(!$connection){
    return false;
}   
if (!mysqli_select_db($connection, "joblicious")) {
    return false;
}
return $connection;

}

function find_jobs(){ db_connect();

$select = "SELECT jobs.id,
                  jobs.location,
                  jobs.title,
                  jobs.company,
                  jobs.description,
                  jobs.url";
$from = "FROM jobs.id";  
$where ="WHERE jobs.id >0";

$query = $select.$from.$where;
$result = mysqli_query(db_connect(),$query);

 while ($row = mysqli_fetch_array($result)){
    echo $row['id'];
 }

}

find_jobs();

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

4条回答 默认 最新

相关推荐 更多相似问题