i have search page where i limit results and split pages....... hi i am using "$page = $_GET['page'];" command but if there is no ?page=1 then it is displaying ""Error Undefined index: page"" if i put ?page=1 then there is no error. my problem is this that at the very first time when i run my page print_marks.php then i can not put ?page=1 but when i press next button within the page ?page=2 automatically appeares in the url.
here is my code
$query = "SELECT COUNT(mdl_assignment_submissions.userid) As num FROM mdl_assignment_submissions Where mdl_assignment_submissions.assignment = 1";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages['num'];
$targetpage = "Print_Marks.php";
$limit = 25;
$page = "1";
$page = $_GET['page'];
if($page)
$start = ($page - 1) * $limit;
else
$start = 0;