I'm trying to create a application for my engineering department, The database has about 3,000 records I was able to create a next and previous link which works fine but they would like to see a first and last link as well
Basically they want FIRST NEXT PREVIOUS LAST
Here is the code I'm using so far
$sql = "SELECT * from tbl_ecr";
$result = mysql_query($sql) or die('Sorry cannot run query');
$limit = 1;
$query_count = "select * from tbl_ecr";
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);
if(empty($page))
$page = 1;
$limitvalue = $page * $limit - ($limit);
$query = "select * from tbl_ecr LIMIT $limitvalue, $limit ";
$result = mysql_query($query) or die("Error: " . mysql_error());
$count_result = mysql_num_rows($result);
echo '<center>';
echo '<table>';
echo '<tr>';
if(($totalrows - ($limit * $page)) > 0) {
$pagenext = $page + 1;
echo "<td><a href=\"$PHP_SELF?page=$pagenext&search=$search\">NEXT</a></td>";
}
if($page != 1){
$pageprev = $page - 1;
echo "<td><a href=\"$PHP_SELF?page=$pageprev&search=$search\">PREV</a> </td>";
}
echo '</tr>';
echo '</table>';
echo '</center>';
echo '<br>';
Can anyone help me or have any ideas. Also I'm trying to figure out how to create a search button, they would like to be able to search on one field(request number), so I'm trying to figure out how to create a link that pops up and ask for what request number they would like and then refresh the page with the number they requested. If anybody has an idea or can point me in the right direction it would be greatly appreciated
Thanks