Please Help Me Out

A Member? Please Login  
type your username and password to login
Date: October 06, 2008, 03:39 PM
246699 members and 145664 Topics
Latest Member: megawaves
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: SAM MILLA, uspry1)  |  Please Help Me Out
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Please Help Me Out  (Read 527 views)
Tosbi (m)
Please Help Me Out
« on: September 04, 2007, 10:31 PM »

Dear fellow Great web designers, I am working on a web project that will require membership where members can search for fellow members in the site. Although, i have no problem with the code for creating such. But where i am confused is the area of breaking pages. I will like you guys to help me out with the PHP CODE for breaking result pages such that, when you search for members on the site, the page should be able to display 10 rows of result and enable you navigate through the rest of the result. An example is when you search on google, the search result page brings only top 10 rows with links to other pages within the searched result because all the results cannot be displayed on only a page. I am sure you guys understand what i mean.
                                                           Thanks
                                                               Smiley
Cactus (m)
Re: Please Help Me Out
« #1 on: September 04, 2007, 11:23 PM »

Google - PAGINATION

Search and read u will have a better understanding than someone providing you with the code
kazey (m)
Re: Please Help Me Out
« #2 on: September 05, 2007, 01:38 AM »

This is actually very easy, and since you mention that you already have php and mysql coding skills , I am going to give you tips. Here I am assuming you know how to write your mysql queries and how to understand written code. The search.php is assumed the file, you can change the name. Feel free to ask any question.


Code:

//Add your mysql query ,
$result = @mysql_query ($query);
$row = mysql_fetch_array ($result, MYSQL_NUM);
$num_records = $row[0];




Code:
// Number of records to show per page:
$display = 10;

// Calculate the number of pages.
if ($num_records > $display) { // More than 1 page.
$num_pages = ceil ($num_records/$display);
} else {
$num_pages = 1;
}


// Make the links to other pages, if necessary.
if ($num_pages > 1) {

echo '<br /><p>';
// Determine what page the script is on.
$current_page = ($start/$display) + 1;

// If it's not the first page, make a Previous button.
if ($current_page != 1) {
echo '<a href="search.php?s=' . ($start - $display) . '&np=' . $num_pages . '&sort=' . $sort .'">Previous</a> ';
}

// Make all the numbered pages.
for ($i = 1; $i <= $num_pages; $i++) {
if ($i != $current_page) {
echo '<a href="search.php?s=' . (($display * ($i - 1))) . '&np=' . $num_pages . '&sort=' . $sort .'">' . $i . '</a> ';
} else {
echo $i . ' ';
}
}

// If it's not the last page, make a Next button.
if ($current_page != $num_pages) {
echo '<a href="search.php?s=' . ($start + $display) . '&np=' . $num_pages . '&sort=' . $sort .'">Next</a>';
}

Looking for a host to host your PHP AND MYSQL Websites? Visit Nairahost Nigeria Now
nduaj (m)
Re: Please Help Me Out
« #3 on: September 05, 2007, 11:24 AM »

hi, i just ran through the code above, nice one, it should work properly on ur project , just customise it to ur site
rufaai (m)
Re: Please Help Me Out
« #4 on: September 05, 2007, 11:28 AM »

WOW!  Cheesy

Kayzey got it all,  I never thought of coding something like that,  Its greate! - I also got a copy for my self.
PHP is HOT!
smartsoft (m)
Re: Please Help Me Out
« #5 on: September 05, 2007, 12:59 PM »

Good one
Afam (m)
Re: Please Help Me Out
« #6 on: September 05, 2007, 02:26 PM »

Quote from: rufaai on September 05, 2007, 11:28 AM
WOW!  Cheesy

Kayzey got it all,  I never thought of coding something like that,  Its greate! - I also got a copy for my self.
PHP is HOT!

No wonder over 70% of dynamic websites in the world run on PHP, never mind people attacking all the time.

With PHP there are no limits especially as it relates to the web, which by the way is what it was designed for in the first place.
xanadu
Re: Please Help Me Out
« #7 on: September 05, 2007, 04:55 PM »

Quote
No wonder over 70% of dynamic websites in the world run on PHP, never mind people attacking all the time.

With PHP there are no limits especially as it relates to the web, which by the way is what it was designed for in the first place.

@Afam, right on! Never mind the people who think PHP is 'lightweight' - the truth is, they do not really know the full powers of PHP. People tend to overlook the fact that it has evolved, over time, into arguably the world's most popular tool for creating dynamic websites.
webdezzi (m)
Re: Please Help Me Out
« #8 on: April 02, 2008, 01:41 PM »

seconded
mambenanje (m)
Re: Please Help Me Out
« #9 on: April 02, 2008, 08:55 PM »

talking about this
Quote
No wonder over 70% of dynamic websites in the world run on PHP, never mind people attacking all the time.

With PHP there are no limits especially as it relates to the web, which by the way is what it was designed for in the first place.

because php runs 70% web it doesnt mean its good enough for real engineering. try to answer this.
 Could Sergey Brin and Larry Page build Google with php ?? what of Gmail can you build that with php and have such ease of use, what of google docs and spreadsheeth.
 
Well facebook.com and yahoo.com are php, do you know the difficulties involved in scalling the server farms.
 php is good for startups because its cheaper to run but in the future you have to change to something more robust like java or C#.
 So its advisable you know java and C# and even ruby on rails though your coding your stuffs in php.
 the guys of facebook all know C++ and right now facebook is running on C++ extensions and no more php
 Hope you get it all, and this is just my own 2 cents so no one should come here and say here I go again talking what I know nothing about
Afam (m)
Re: Please Help Me Out
« #10 on: April 02, 2008, 09:59 PM »

Go out there are learn what you don't understand. Trying to use ill thought out comments to get enlightenment on issues won't get you anywhere.

PHP is for startups. This is the most stupid comment I have read on this forum by someone that thinks he knows.
hanen (f)
Re: Please Help Me Out
« #11 on: April 03, 2008, 08:52 AM »

@mambenanje

this is the second time i've seen you talk absolute jargon about a very simple issue,  needless to say I'm worried. I evn have to second Afam.
kazey (m)
Re: Please Help Me Out
« #12 on: April 03, 2008, 11:12 AM »

{quote author=mambenanje link=topic=76867.msg2116311#msg2116311 date=1207166134]
talking about this
because php runs 70% web it doesnt mean its good enough for real engineering. try to answer this.
 Could Sergey Brin and Larry Page build Google with php ?? what of Gmail can you build that with php and have such ease of use, what of google docs and spreadsheeth.
 
Well facebook.com and yahoo.com are php, do you know the difficulties involved in scalling the server farms.
 php is good for startups because its cheaper to run but in the future you have to change to something more robust like java or C#.

Quote

You don't know what you are talking about, and because of that I wont waste my time explaining the dynamics of programming  languages, and how they are used for different purposes etc. 
Afam (m)
Re: Please Help Me Out
« #13 on: April 03, 2008, 12:47 PM »

Quote from: kazey on April 03, 2008, 11:12 AM
You don't know what you are talking about, and because of that I wont waste my time explaining the dynamics of programming  languages, and how they are used for different purposes etc. 

Exactly, he wants someone to explain to him and yet he is not humble enough to ask for help.

I noticed this sometime ago and stated that he was obviously new to the web. He disagreed, well  maybe he spends most of his online time watching porn otherwise someone that claims to know shouldn't even be asking about the meaning of web 2.0 let alone making the ridiculous statements he made on this particular thread on PHP.

And to imagine that this clown was offering useless advice on how I should develop a website, nothing wey person no go see for nairaland.
mambenanje (m)
Re: Please Help Me Out
« #14 on: April 03, 2008, 02:36 PM »

though I have better things to do I saw the attacks so I decided to clearify myself.
 please all the guys thinking I don't know what I was talking about please take some time off and read this and after reading

http://www.cmswire.com/cms/industry-news/php-vs-java-vs-ruby-000887.php

 then we can argue but constructively because I don't have time to arguing destructively.

if you read that article very well dated November 2006, you will understand why I said php is good for startups and for big projects people go direct for java and the main advantage is that java supports BIG TEAMS WORKING ON ONE PROJECT TOGETHER. php supports this sparsely unless you go for ruby on rails ports.
 
@Afam I am tired of your talks of me knowing nothing and new on the web. this is my current project www.studentnetworks.in and yes I am in Africa but working on an Indian website. Please try talk less about others you barely know. more to that I am Macromedia Certified since 2005. I don't talk about what I don't know I read articles and add to my skills everyday. I hope next time you wont say I know nothing. and as an advice try to signup for some google alerts for some topics you like it will give you articles to read everyday because you are not soo current.
Good Luck
my2cents (m)
Re: Please Help Me Out
« #15 on: April 03, 2008, 02:40 PM »

he heeeeeeeeeeeeeeeee (my laff don dey reach london Grin)h!!

Una never finish this one http://www.nairaland.com/nigeria/topic-115434.0.html and now una wan start another one.

In my opinion, the guy who asked for help will end up probably being traumatized and confused by the time this is over.  Dude asked for help and instead he has to discern whether or not PHP is used for startups/mature organized, as opposed to the help he needs.  Not to mention, if I am not mistaken, this thread was posted some time last year.  In the event that it is resurrected, should it be for this?

Where is uspry1 when you need her?  Cool

he heeeeeeeeeeddddddeeeeeee (my laff don reach london.  Now e dey go hamburg Grin)h!!
Afam (m)
Re: Please Help Me Out
« #16 on: April 03, 2008, 03:34 PM »

Quote from: mambenanje on April 03, 2008, 02:36 PM

And he points us to a website running on PHP, wonders shall never end.
uspry1 (f)
Re: Please Help Me Out
« #17 on: April 03, 2008, 03:40 PM »

@afam and mambenanje

PLEASE ACT YOUR AGE ! Stop fighting over which programming (PHP vs Ruby/Java/C#) is the best. The poster asks for help, not what you both talk about this programming. OKAY!

This is based on the client who hires the person to do the job providing the specified programming, design layout, and identity the client wants, not you! OKAY!

Afam is PHP programmer, not a web designer, dealing with web portal development using PHP. But Mambenanje is certified Flash developer dealing with dynamic website development using Flash Actionscript to incorporate external files such as C#, PHP, XML, etc.

Both are different programmers! OKAY!

@mambenanje

I look at your link: http://www.studentnetworks.in is still incomplete site! However it is nice design work!

Two other sites i saw: 2faceidibiafans.com and webyfolio.com are awesome, too!

=====  ATTENTION  ======

By the way for both of you @Afam and Mambenanje, why don't you help out this poster, @Tosbi  to figure out how to incoroporate the pagination on his existing site?

Ose gan!!!
Afam (m)
Re: Please Help Me Out
« #18 on: April 03, 2008, 03:45 PM »

ACT MY AGE? For responding to someone that clearly does not have a clue about what he is talking about?

Or do you subscribe to people misleading others on this forum.

Anyone that posts nonsense should as a matter of urgency be corrected lest people get the wrong impression that the forum is made up of people that know next to nothing.

Quote from: my2cents on April 03, 2008, 02:40 PM
he heeeeeeeeeeeeeeeee (my laff don dey reach london Grin)h!!

Una never finish this one http://www.nairaland.com/nigeria/topic-115434.0.html and now una wan start another one.


Reminds me of some people in the village that are only happy when other people have problems. Poor style.
mambenanje (m)
Re: Please Help Me Out
« #19 on: April 03, 2008, 04:16 PM »

@Afam thanks for understanding and also proving how good a webmaster you are bye
webdezzi (m)
Re: Please Help Me Out
« #20 on: April 10, 2008, 09:20 AM »

mambenanje, please correct that statement, php is NOT meant for start ups
mambenanje (m)
Re: Please Help Me Out
« #21 on: April 10, 2008, 06:58 PM »

@webdezi
 if thats what will please you fine, php is not meant for startups.
 But as a personal advice from my experience I will wish to inform you that if you plan to make a multinational project that wil have servers in AFrica, Europe and Asia please go with something like java, python, C#(asp.net) because its more robust and if you need about 20 guys working on one section of your website, count php out because its having serious issues when it comes to team work.
 Well this is what I am telling guys from my idea as a web developer with two startups to my profile, but you can take it or leave it
Tosbi (m)
Re: Please Help Me Out
« #22 on: April 17, 2008, 05:34 PM »

Hi guys. thanks alot for all the response so far. It's amazing to see that a topic that is more than a year old is still been delibrated upon. well, i ve actually gotten the needed code thanks to kazey within short days of posting this topic. Once again, i say a big thank you to you guys for your co-operation.
                               Long live Nigerian Webmasters.
Abidemi_A
Re: Please Help Me Out
« #23 on: April 17, 2008, 10:40 PM »

It is good to understand more than one language, you should concentrate more on OOP Language. Although PHP5> supports OOP, you can not compare its level of support with that of C# OR Java.
Abidemi_A
Re: Please Help Me Out
« #24 on: April 17, 2008, 10:49 PM »

@Tosbi ,

You can easily achieve your objective with gridview if you use C#.NET within VS2005 IDE. It will benefit you in future if you start laying your hands on C# now, it is not as difficult as you think, I even consider it simpler than PHP, with little lines of code, you achieve a lot.

Let me have your link when the job is completed.

Happy programming.

 
 I Need Someone To Design A Free Website For Me Please  What Do you all think of www.ngige.com  Comment on this site i made-thanks  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.