mysqli_query(): Couldn't fetch mysqli
Warning: mysql_num_rows() expects parameter 1 to be resource, object given in D:\wamp\www\2017-last class\NO-10-Mysql\article\admin\article.search.php on line 6
出现以上的的错误,
<?php
require_once('../connect.php');
$key = $_GET['key'];
$sql = "select * from article where title like '%$key%' order by dateline desc";
$query = mysqli_query($con,$sql);
if($query&&mysqli_num_rows($query)){
while($row=mysqli_fetch_assoc($query)){
$data[]=$row;
}
}
//print_r($data);
?>
代码没错啊