I want to display all products from my table product in my database. I have around 450 products in it . But using a simple select statement is not working and not returning any data unless in the select query I set a limit of 22 .
I did a little research and here are some points I'd like to make clear:
1.Most online sites suggest that a memory limit is causing it and to change the same in php.ini
And I tried it and it still didnt help
2.The connection is not an error as it works when a limit is set.
3.The console and dev tools in the browser do not show any errors.
4.I did a fair amount of research and everywhere it said to increase memory like the first point but it didnt work .
5.I am using xampp to run.
6.The select statement works perfectly when i ran it on phpMyAdmin, it displayed all 450 products there.
7.I have set all php error showers to on in php.ini and it still no error
8.error.logs is also not showing any errors
this is my php code:
<?php
include "dbconfig1.php";
$data = array();
$q = mysqli_query($connection,"select * from product limit 22");
while ($row = mysqli_fetch_assoc($q)){
$data[] = $row;
}
echo json_encode($data);
echo mysqli_error($connection);