mysql_num_rows 関数を使用して num_rows をカウントしようとしましたが、エラーが発生し続けます。私のクエリにはエラーはありません。何が問題なのだろう
<?php
if(isset($_POST['search'])){
$search = $_POST['search'];
// connect to database
$con = mysqli_connect("localhost", "root","", "ajax") or die ("could not connect to database");
$query = "SELECT * FROM searchengine WHERE title LIKE '%$search%' ";
$get_query = mysqli_query($con, $query) or die("can't execute query");
$rows = mysqli_fetch_array($get_query);
$num = mysql_num_rows($get_query);
echo $num;
while($row = mysqli_fetch_array($get_query)){
echo "resuslts found ".'<br/>';
echo $row['title'];
}
}
else{
echo " not set";
}
?>