Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,151,361 members, 7,812,019 topics. Date: Monday, 29 April 2024 at 06:28 AM |
Nairaland Forum / Falisto's Profile / Falisto's Posts
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 11 pages)
Programming / Re: Please Help Me In This PHP Pagination Code by Falisto: 6:41pm On Aug 08, 2018 |
Ok. Ill try it. Thanks. |
Business / Re: List Of Business Networking websites by Falisto: 11:57am On Aug 06, 2018 |
Get the list of business networking websites on www.businessguide.com.ng |
Business / List Of Business Networking websites by Falisto: 11:56am On Aug 06, 2018 |
Get the list of business networking websites on www.businessguide.com.ng 1 Like |
Programming / Please Help Me In This PHP Pagination Code by Falisto: 6:40pm On Aug 05, 2018 |
Hi, Good Nairaland programmers, I want you to help me in this PHP pagination code. It is always giving out error message whenever i click at the next link. please help me to look at it and help me to make corrections. Thanks. The code is here below: <?php // Get the search variable from URL if(isset($_POST['SUBMIT'])){ $professionals = $_POST['profession']; $country = $_POST['country']; } elseif(isset($_GET['_xp'],$_GET['_xs'])){ $professionals = $_GET['_xp']; $country = $_GET['_xs']; } // rows to return $limit=10; $professionals = $_POST['profession']; $country = $_POST['country']; //connect to your database ** EDIT REQUIRED HERE ** $conn = mysql_connect("localhost","profes13_members","notebook8a1c" $db = mysql_select_db("profes13_list", $conn); //specify database ** EDIT REQUIRED HERE ** // Build SQL Query $s = (isset($_GET['s']))? $_GET['s']:0; $query = "select * from members where profession ='$professionals' order by RAND() "; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); // If we have no results, offer a google search as an alternative if ($numrows == 0) { echo "<h4>Results</h4>"; echo "your search returned zero result<br>"; echo"<a href = 'memberusage.php'>CONTINUE SEARCH HERE</A>"; } // next determine if s has been passed to script, if not use 0 $s = (isset($_GET['s']))? $_GET['s']:0; // get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query" // display what the person searched for // begin to show results set echo "Results"; $count = 1 + $s ; // now you can display the results returned while ($row= mysql_fetch_array($result)) { $username = $row["username"]; $name =$row['name']; $gender =$row['gender']; $profession = $row['profession']; $pics = $row['pics']; $num = "($count )"; echo $num; ?> <img src= "<?php echo $pics; ?>" alt="Nigerian Directory of Professionals" width="70" height="70" /><br /> <b>Name</b>::<b><font color="#009933"> <?php echo $name ?></font></b><br /> <?php echo "<a href='profile.php?id=" . $username . "'> "."".""." View $name's profile </a><br>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; $count++ ; } $currPage = (($s/$limit) + 1); //break before paging echo " <br />" ; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " <a href=\"" . $_SERVER['PHP_SELF'] . "?s=$prevs&_xp\"><< Prev 10</a>  "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo " <a href=\"" . $_SERVER['PHP_SELF'] . "?s=$news&_xp\">Next 10 >></a>"; } $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "<p>Showing results $b to $a of $numrows</p>"; ?> |
Religion / Re: Churches And Pastors With Private University in Nigeria (pics) by Falisto: 4:07am On Mar 13, 2018 |
www.business guide.com.ng |
(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 11 pages)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15 |