Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,853 members, 7,810,281 topics. Date: Saturday, 27 April 2024 at 05:10 AM

Please Help Me Out - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Please Help Me Out (1780 Views)

(2) (3) (4)

(1) (Reply) (Go Down)

Please Help Me Out by Tosbi(m): 10:31pm On Sep 04, 2007
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 cos all the results cannot be displayed on only a page. I am sure you guys understand what i mean.
Thanks
smiley
Re: Please Help Me Out by Cactus(m): 11:23pm On Sep 04, 2007
Google - PAGINATION

Search and read u will have a better understanding than someone providing you with the code
Re: Please Help Me Out by kazey(m): 1:38am On Sep 05, 2007
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.




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






// 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 '
<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
Re: Please Help Me Out by nduaj(m): 11:24am On Sep 05, 2007
hi, i just ran thru the code above, nice one, it shud work properly on ur project , just customise it to ur site
Re: Please Help Me Out by rufaai(m): 11:28am On Sep 05, 2007
WOW! cheesy

Kayzey got it all, I neva thought of coding something like that, Its greate! - I also got a copy for my self.
PHP is HOT!
Re: Please Help Me Out by smartsoft(m): 12:59pm On Sep 05, 2007
Good one
Re: Please Help Me Out by Afam(m): 2:26pm On Sep 05, 2007
rufaai:

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.
Re: Please Help Me Out by xanadu: 4:55pm On Sep 05, 2007
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.
Re: Please Help Me Out by Nobody: 1:41pm On Apr 02, 2008
seconded
Re: Please Help Me Out by mambenanje(m): 8:55pm On Apr 02, 2008
talking about this
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 cos 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
Re: Please Help Me Out by Afam(m): 9:59pm On Apr 02, 2008
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.
Re: Please Help Me Out by hanen(f): 8:52am On Apr 03, 2008
@mambenanje

this is the second time i've seen you talk absolute jargon about a very simple issue, needless to say im worried. I evn have to second Afam.
Re: Please Help Me Out by kazey(m): 11:12am On Apr 03, 2008
{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][/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.
Re: Please Help Me Out by Afam(m): 12:47pm On Apr 03, 2008
kazey:

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.
Re: Please Help Me Out by mambenanje(m): 2:36pm On Apr 03, 2008
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
Re: Please Help Me Out by my2cents(m): 2:40pm On Apr 03, 2008
he heeeeeeeeeeeeeeeee (my laff don dey reach london grin)h!!

Una never finish this one https://www.nairaland.com/nigeria/topic-115434.0.html and now una wan start anoda 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!!
Re: Please Help Me Out by Afam(m): 3:34pm On Apr 03, 2008
mambenanje:


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


And he points us to a website running on PHP, wonders shall never end.
Re: Please Help Me Out by uspry1(f): 3:40pm On Apr 03, 2008
@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!

[center]===== ATTENTION ======[/center]
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!!!
Re: Please Help Me Out by Afam(m): 3:45pm On Apr 03, 2008
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.

my2cents:

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

Una never finish this one https://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.
Re: Please Help Me Out by mambenanje(m): 4:16pm On Apr 03, 2008
@Afam thanks for understanding and also proving how good a webmaster you are bye
Re: Please Help Me Out by Nobody: 9:20am On Apr 10, 2008
mambenanje, pls correct that statement, php is NOT meant for start ups
Re: Please Help Me Out by mambenanje(m): 6:58pm On Apr 10, 2008
@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
Re: Please Help Me Out by Tosbi(m): 5:34pm On Apr 17, 2008
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.
Re: Please Help Me Out by AbidemiA: 10:40pm On Apr 17, 2008
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.
Re: Please Help Me Out by AbidemiA: 10:49pm On Apr 17, 2008
@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.

(1) (Reply)

Php Tutorials For Beginners: Teach Yourself Php With Free Video / Twitter Follow And Retweet Group / If You Are A Ghanaian, Come And Collect This Ghana Adsense For #19,999

(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. 46
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.