-1

I am trying to display mysql data in a table except nothing is being display.

<?php
                    $query = $koneksi->prepare("SELECT name,kill,death from `player`");
                    $query->execute();
                    if($query->rowCount() == 0)
                    {

Here I am getting the data

    {
                        echo "<tr><td colspan='6'><small>There's no player on ban list</small></td></tr>";
                    }
                    while($data = $query->fetch())
                    {
                        echo "<tr><td>".$data['name']."</td>";
                        echo "<td>".$data['kill']."</td>";
                        echo "<td>".$data['death']."</td>";
                        $kd = $data['kill'] / $data['death'];
                        echo "<td>".$kd."</td></tr>";
                    }
                    ?>

Now I am displaying the data except nothing shows.

ZiiM
  • 31
  • 1
  • 6

1 Answers1

1

kill is a reserved word. Try to surround it by backticks like `kill`

Salman A
  • 262,204
  • 82
  • 430
  • 521
Jehad Keriaki
  • 545
  • 5
  • 10