I'm using this to fetch results from database.
$from=$to; ////limit from
$to=$from+5; ////limit to
$search_query="SELECT * FROM `user_info_secondary` WHERE `city`='$query' LIMIT $from,$to"
When i set $to=0;
the search yields exactly 5 results but when i set to $to=5,10,15....
its shows me 6 results why is that?
$from=$to;
$to=$from+5;
$search_query="SELECT * FROM `user_info_secondary` WHERE `city`='$query' LIMIT $from,$to";
$do_search= mysqli_query($connection, $search_query);
$number_of_results= mysqli_num_rows($do_search);
while($number_of_results>0)
{
$get_result_details= mysqli_fetch_array($do_search);
$search_result_details= $get_result_details['username'];
echo $search_result_details;
--$number_of_results;
}