Mysql and PHP leaderboard acting strange -
i trying make leaderboard , sort data kills, when try make grabs name, kill, death doesnt grab when have grab works. know why? code below please assist.
<?php $query = $koneksi->prepare("select * `player`"); $query->execute(); if($query->rowcount() == 0)
i grabbing mysql data here, if change * data need no data displayed.
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>"; } ?>
is or wrong? confused.
here have use bind_result()
, in have pass number of parameters equal number of field player
table.
because here fetching data using select *
query.
Comments
Post a Comment