rabesh Posted June 1, 2011 Share Posted June 1, 2011 code is <?php $limit=12; if(isset( $_GET['page'])) $page=$_GET['page']; if($page<=0) $page = 1; else {$start=0;} $sql=mysql_query("select * from tbl_gallery where status=1 And category_name='0'"); $count=mysql_num_rows($sql); $totalcount=ceil($count/$limit);$start=($page-1)*$limit; $s=mysql_query("select * from tbl_gallery where status=1 And category_name='0' limit $start, $limit"); while($result=mysql_fetch_array($s)){ $start++; ?> PLZ find the mistake Quote Link to comment https://forums.phpfreaks.com/topic/238066-notice-undefined-variable-page-in/ Share on other sites More sharing options...
xyph Posted June 1, 2011 Share Posted June 1, 2011 Your use of curly braces if ( cond ) { action action } Quote Link to comment https://forums.phpfreaks.com/topic/238066-notice-undefined-variable-page-in/#findComment-1223359 Share on other sites More sharing options...
rabesh Posted June 1, 2011 Author Share Posted June 1, 2011 I dont get mistake plz correct in my code Quote Link to comment https://forums.phpfreaks.com/topic/238066-notice-undefined-variable-page-in/#findComment-1223363 Share on other sites More sharing options...
hyster Posted June 1, 2011 Share Posted June 1, 2011 if(isset( $_GET['page'])) { ////<--- missing { code code } ////<--- missing } after the code u want included in isset ?> Quote Link to comment https://forums.phpfreaks.com/topic/238066-notice-undefined-variable-page-in/#findComment-1223370 Share on other sites More sharing options...
MasterACE14 Posted June 1, 2011 Share Posted June 1, 2011 after: if(isset( $_GET['page'])) $page=$_GET['page']; add: else { $_GET['page'] = 1; $page = $_GET['page']; } Regards, Ace Quote Link to comment https://forums.phpfreaks.com/topic/238066-notice-undefined-variable-page-in/#findComment-1223371 Share on other sites More sharing options...
rabesh Posted June 1, 2011 Author Share Posted June 1, 2011 Thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/238066-notice-undefined-variable-page-in/#findComment-1223376 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.