Hey guys, i am new to php ..I really needed your help with pagination in php .The issue is when i look at the out put, i dont see any thing.. just blank screen. Database and other details are correct. I rechecked it
Here is my code :
<?php
$host="xxxxxx"; // Host name
$username="xxx_username"; // Mysql username
$password="xxx_password"; // Mysql password
$db_name="xxx_databasename"; // Database name
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$per_page = 6;
$pages_query = mysql_query("SELECT COUNT (*) FROM 'xxx_tablename'");
$pages = ceil(mysql_result($pages_query, 0) / $per_page);
$page = (isset($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$query = mysql_query("SELECT * FROM 'members_list' LIMIT $start, $per_page");
while ($query_row = mysql_fetch_assoc($query)){
echo '<table id="table-3">';
echo '<thead>';
echo '<th> Name : </th>';
echo '<th> Address : </th>';
echo '<th>Zip Code : </th>';
echo '</thead>';
echo '<tbody>';
echo '<tr>';
echo '<td>', $query_row['name'], '</td>';
echo '<td>', $query_row['address'] ,'</td>';
echo '<td>', $query_row['zipcode'], '</td>';
echo '</tr>';
echo '</tbody> ';
echo '</table>';
}
?>
<?php
// close MySQL connection
mysql_close();
?>
Didnt complete it because with this much code forget pagination but atleast the data should be visible..
any one ?