nested if else syntax error php -
this question has answer here:
- php parse/syntax errors; , how solve them? 11 answers
says syntax error t_else, problem? it making me crazy finding did wrong in code myy mistake here?
<?php include("../mysql_connect.php"); if (isset($_post['search_form'])) { $page1 = $_get['page']; if ($page1 == "" || $page1 == 1) { $page1 = 0; } else { $page1 = ($page1 * 5) - 5; } $query = "select * tbl_news news_title '$_post[search]' || news_author '$_post[search]' "; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { ?> <table class="table table-hover" border="2"> <col width="50%"></col> <col width="40%"></col> <col width="20%"></col> <tr> <td rowspan="3"> href="news_view.php?id=<?php echo $row['news_id']; ?>"> <img src="<?php echo $row['news_image_location'] . $row['news_image']; ?>" height="300" width="500"> </a> </td> <td>title: <?php echo $row['news_title']; ?></td> </tr> <tr> <td>author: <?php echo $row['news_author']; ?></td> </tr> <tr> <td>date: <?php echo $row['news_date_filed']; ?></td> </tr> </thead> </table> <?php } $query1 = "select * tbl_news news_title '$_post[search]' || news_author '$_post[search]'"; $result1 = mysql_query($query1); $row1 = mysql_num_rows($result1); $pagecount = $row1 / 5; $pagecount = ceil($pagecount); ($count = 1; $count <= $pagecount; $count++) { ?> <a href="news.php?page=<?php echo $count; ?>"><?php echo $count ?></a> <?php } } else{ $page1 = $_get['page']; if ($page1 == "" || $page1 == 1) { $page1 = 0; } else { $page1 = ($page1 * 5) - 5; } $query = "select * tbl_news news_status='active' limit $page1,5"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { ?> <table class="table table-hover" border="2"> <col width="50%"></col> <col width="40%"></col> <col width="20%"></col> <tr> <td rowspan="3"> <a href="news_view.php?id=<?php echo $row['news_id']; ?>"> <img src="<?php echo $row['news_image_location'] . $row['news_image']; ?>" height="300" width="500"> </a> </td> <td>title: <?php echo $row['news_title']; ?></td> </tr> <tr> <td>author: <?php echo $row['news_author']; ?></td> </tr> <tr> <td>date: <?php echo $row['news_date_filed']; ?></td> </tr> </thead> </table> <?php } ?> <?php $query1 = "select * tbl_news news_status='active'"; $result1 = mysql_query($query1); $row1 = mysql_num_rows($result1); $pagecount = $row1 / 5; $pagecount = ceil($pagecount); ($count = 1; $count <= $pagecount; $count++) { ?> <a href="news.php?page=<?php echo $count; ?>"><?php echo $count ?></a> <?php # code... } } ?> here full code, of errror gives me, please me guys takes me a lot of time having kind of problem tried maybe guys me solve problem hahahaha drained mind here , im mindblown on facing problem
you missing < @ tag inside first while loop (exactly on line 21 when copy/paste code). might reason doesn't recognize else statement, because can't properly.
Comments
Post a Comment