replace
if(mysqli_num_rows($query) > 0){
$row = mysqli_fetch_row($query);
with
while($row = mysqli_fetch_row($query)){
replace
if(mysqli_num_rows($query) > 0){
$row = mysqli_fetch_row($query);
with
while($row = mysqli_fetch_row($query)){