I want to display my database into my webpage in tables. but it cant, i pretty sure that my database name is same. if i run, ".$no.", ".$row['nama'].", ".$row['email']." and ".$row['message']." will displayed on webpage. not data from database. please help.
here is my code:
<table class="table">
<thead>
<tr>
<th>#</th>
<th>Nama</th>
<th>E-mail</th>
<th>Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
</tbody>
<?php
include "conection.php";
$no = 1;
$query = mysql_query("SELECT * FROM comment");
if ($query) {
while ($row = mysql_fetch_array($query)) {
echo "
<tr>
<td>".$no."</td>
<td>".$row['nama']."</td>
<td>".$row['email']."</td>
<td>".$row['message']."</td>
</tr>
";
$no++;
}
}
?>
</table>
this is my conection.php
<?php
$db_host = "localhost";
$db_user = "root";
$db_pass = "";
$db_name = "toefl";
$koneksi = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
if(mysqli_connect_error()){
echo 'database error : '.mysqli_connect_error();
}
?>
