<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php
$hostname_doktor = 'localhost';
$username_doktor = 'root';
$password_doktor = '';
$conn = mysql_connect($hostname_doktor, $username_doktor,$password_doktor) or die ('Error connecting to mysql');
$database_doktor = 'doktor';
mysql_select_db($database_doktor);

$limit = 2;
if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * $limit;

$negara=(isset($_POST['negara']));
$IdWarga=(isset($_POST['IdWarga']));

$query = ("SELECT * FROM warganegara WHERE IdWarga = '$IdWarga' ORDER BY $IdWarga");
$result = mysql_query ($query);
?>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>title</th>
<th>body</th>
</tr>
<thead>
<tbody>
<?php
while ($row = mysql_fetch_assoc($result)) { <---error
?>
<tr>
<td><? echo $row["title"]; ?></td>
<td><? echo $row["body"]; ?></td>
</tr>
<?php
};
?>
</tbody>
</table>
<?php
$query = "SELECT COUNT(negara) FROM warganegara";
$result = mysql_query($query);
//$row = mysql_fetch_row($result);
$total_records = $row[0];
$total_pages = ceil($total_records / $limit);
$pagLink = "<div class='pagination'>";
for ($i=1; $i<=$total_pages; $i++) {
$pagLink .= "<a href='add_warganewAdmin.php?page=".$i."'>".$i."</a>";
};
echo $pagLink . "</div>";
?>

</body>
</html>


otai php tulun..