coolcool
11-18-2011, 11:28 AM
i have3 Table
block table
id,block
(total 9 blocks based on cityname ex:london,mumbai....)
users table
id,username,password,block,access
(this is registration form fields.Select your block from drop down menu)
total 3 acess levels
0 for admin,1 for editor and 2 for regular user
form table
id,block,scheme,status. (Select your block from drop down menu)
i have a working login registration system also successfully get the results from the Form table.
My code
<?php
include '../include/functions.php';
if(!loggedin()) {
header("Location: login.php");
exit ();
}
$per_page = 3;
$pages_query = mysql_query("SELECT COUNT('id') FROM form");
$pages = ceil(mysql_result($pages_query, 0) / $per_page);
$page = (isset ($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$result = mysql_query("SELECT * FROM form");
echo "<table>
<tr>
<th>ID</th>
<th>Block</th>
<th>SCHEME NAME</th>
<th>Status</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['block'] . "</td>";
echo "<td>" . $row['scheme'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "Page: ";
if($pages>=1 && $page<=$pages) {
for($x=1; $x<=$pages; $x++) {
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a> ' ;
}
}
?>
But i need if a user is from london block then show only london block results of Form table and if from mumbai show only mumbai results of Form table.
Please help friends.
block table
id,block
(total 9 blocks based on cityname ex:london,mumbai....)
users table
id,username,password,block,access
(this is registration form fields.Select your block from drop down menu)
total 3 acess levels
0 for admin,1 for editor and 2 for regular user
form table
id,block,scheme,status. (Select your block from drop down menu)
i have a working login registration system also successfully get the results from the Form table.
My code
<?php
include '../include/functions.php';
if(!loggedin()) {
header("Location: login.php");
exit ();
}
$per_page = 3;
$pages_query = mysql_query("SELECT COUNT('id') FROM form");
$pages = ceil(mysql_result($pages_query, 0) / $per_page);
$page = (isset ($_GET['page'])) ? (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;
$result = mysql_query("SELECT * FROM form");
echo "<table>
<tr>
<th>ID</th>
<th>Block</th>
<th>SCHEME NAME</th>
<th>Status</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['block'] . "</td>";
echo "<td>" . $row['scheme'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "Page: ";
if($pages>=1 && $page<=$pages) {
for($x=1; $x<=$pages; $x++) {
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a> ' ;
}
}
?>
But i need if a user is from london block then show only london block results of Form table and if from mumbai show only mumbai results of Form table.
Please help friends.