Jump to content
#StayAtHome ×

tapantor24

Members
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

0 Neutral

About tapantor24

  • Rank
    Member
  1. Many many thx friend @dalecosp It's solve my problem. But how I apply it in many condition. Such as age between age. Thanks again.
  2. It's a long database. It's will show 10 result each page. First page going fine but next show no category found. It's also going fine when i replace this WHERE `phone` = '$phone' to WHERE ’phone’ = ’01736659047 ’ or manually type any number from the database.
  3. Look at this code. This is search function with pagination. I want to use this code in project of my client but problem is that the search result show on first page normally but when i press next button it's going wrong. It's show no category found. I spend many tiime to solve this but result is zero. Pls help me any one to solve thise.. <?php //include out functions file giving us access to the protect() function made earlier include "./include/database.php"; ?> <?php $phone = ($_POST['phone']); $productsPerRow = 2; $perpage = 10; if(isset($_GET["page"])) { $page = intval($_GET["page"]); } else { $page = 1; } $calc = $perpage * $page; $start = $calc - $perpage; $result = mysql_query("SELECT * FROM `bookmark` WHERE `phone` = '$phone' Limit $start, $perpage"); $rows = mysql_num_rows($result); $columnWidth = (int)(100 / $productsPerRow); if($rows>0){ $i=0; ?> <table width='100%' border='0' align='center' cellpadding='5' cellspacing='1' class='bookmark'> <?php while($row = mysql_fetch_array($result)) { //$row['Photo'] = "<img src="/user_image/ . $row['Photo']; ""/> if ($i % $productsPerRow == 0) { ?> <tr > <?php } $Sub =$row['Sub']; $url=$row['Link']; $Phone =$row['phone']; $info =$row['info']; ?> <td width="$columnWidth%" >Subject: <?php echo $row['Sub'];?><br/> Link: <?php echo $row['Link'];?><br/> Mobile: <?php echo $row['phone'];?><br/> Information: <?php if($info != '') { ?> <?php echo $row['info'];?> <?php }else { echo "N/A"; } ?> </td> <?php if ($i % $productsPerRow == $productsPerRow - 1) { echo '</tr>'; } $i += 1; } if ($i % $productsPerRow > 0) { echo '<td colspan="' . ($productsPerRow - ($i % $productsPerRow)) . '"> </td>'; } } else { ?> No products in this category <?php } ?> </table> <table width="100%" cellspacing="2" cellpadding="2" align="center" > <tr> <td align="center"> <?php if(isset($page)) { $result = mysql_query("select Count(*) As Total from bookmark WHERE `phone` = '$phone'"); $rows = mysql_num_rows($result); if($rows) { $rs = mysql_fetch_array($result); $total = $rs["Total"]; } $totalPages = ceil($total / $perpage); if($page <=1 ) { echo "<span id='page_links' style='font-weight:bold;'>Prev</span>"; } else { $j = $page - 1; echo "<span><a id='page_a_link' href='info5.php?page=$j'>< Prev</a></span>"; } for($i=1; $i <= $totalPages; $i++) { if($i<>$page) { echo "<span><a href='info5.php?page=$i' id='page_a_link'>$i</a></span>"; } else { echo "<span id='page_links' style='font-weight:bold;'>$i</span>"; } } if($page == $totalPages ) { echo "<span id='page_links' style='font-weight:bold;'>Next ></span>"; } else { $j = $page + 1; echo "<span><a href='info5.php?page=$j' id='page_a_link'>Next</a></span>"; } } ?> <td> </tr> </table> <form action="info5.php" method="POST"> <input name="phone" id="phone" type="text" size="25" class="box" value="Type Mobile No…" onfocus="this.value=(this.value=='Type Mobile No…')? '' : this.value ;" /> <input type="submit" name="submit" class="box" id="submit" value="Search" /> </form>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.