So I'm having this issue, where only one table just doesn't want to work.
I have a simple php api. All it does is query data from the databases. I have a lot of tables and they are all structured the same. (mostly) Table name are md_12_201807. But this one doesn't display anything. It works in phpmyadmin, but doesn't when I use the api.
CODE:
$ceg = $_GET['ceg'];
$kir = $_GET['kir'];
$ido = $_GET['ido'];
$return = array();
$q = "SELECT * FROM `{$ceg}_{$kir}_{$ido}`";
$sq = mysqli_query($server, $q);
switch ($ceg) {
case 'md':
while ($sqa = mysqli_fetch_assoc($sq)) {
$temp = array(
'id'=> $sqa['id'],
'cegnev'=> $sqa['cegnev'],
'projekt_vezeto'=> $sqa['projekt_vezeto'],
'projekt_ertekesito'=> $sqa['projekt_ertekesito']
);
array_push($return, $temp);
}
....
if (isAuth && $sq) {
header("Content-Type: application/json; charset= utf-8");
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Accept");
echo json_encode($return,JSON_FORCE_OBJECT);
}
It does work, for all other tables, but this one. In the admin I looked at it but there is nothing strange, it looks just like the others.
Anyone seen something like this?