I have the following mysql request in my php file:
$command = "SELECT weapon_id, weapon_name, weapon_dammage, weapon_munitions FROM weapon;";
$result = mysqli_query($connection, $command);
$rows = array();
while($r = mysqli_fetch_assoc($result)) {
$rows[] = array(
'weapon_id' => $r['weapon_id'],
'weapon_name' => $r['weapon_name'],
'weapon_dammage' => $r['weapon_dammage'],
'weapon_munitions ' => $r['weapon_munitions ']
);
}
echo json_encode($rows);
I don't understand why there is nothing returned (I have a blank page). My request is good (tested), and the same code works with anoter request (for example SELECT * FROM player).
Do you know what is the problem and how to solve it?
Thanks a lot!