Helo, I using "bind_result", "LIKE CONCAT" ... to reach full text search and pagination by two query string.
but how can I change bind_result methods to fetch_assoc?
<?php
$mysqli = new mysqli("localhost", "", "", "test");
$query_string="hello"; //keywords
$sqltxt="SELECT * FROM `table` WHERE text1 LIKE CONCAT('%', ?, '%')";
//first query : for get the total number of data
$stmt = $mysqli->prepare($sqltxt);
$stmt->bind_param("s",$query_string);
$stmt->execute();
$stmt->store_result();
$total =$stmt->num_rows;
$lastpage = ceil($total/20);//obtain the last page
$page=$_GET["page"];
$startpoint = ($page * 20) - 20;
//second query : for get the true data
$stmt = $mysqli->prepare($sqltxt ." LIMIT {$startpoint}, 20");
$stmt->bind_param("s",$query_string);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($id,$title,$tel); //<= hits!! I want to using fetch_assoc methods
while($stmt->fetch()){ //<= hits!! I want to using fetch_assoc methods
echo $id;
echo $atitle;
echo $tel;
}
?>
Thanks!