Help needed in PHP + MySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CrackEEr
Forum Newbie
Posts: 4
Joined: Sun Apr 16, 2006 1:18 am

Help needed in PHP + MySQL

Post by CrackEEr »

Can any body here help me out ?I m new to PHP n MYSQL....

I m using PHP 5 +MySQL + Apache.
I need a code in PHP which does the following ?


When i click the first button it goes to the first item in the table
When i click the last button it goes to the last item in the table
When i click the next button it goes to the next item in the table
When i click the last button it goes to the last item in the table.
N i have to show the result in a textbox.

Please help me guys.Atleast tell me idea how to do it.
Using Access and VB was very easy.But i dont know how to do it in PHP n MySQL.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

If you post your vb code, perhaps we can help you convert it.
CrackEEr
Forum Newbie
Posts: 4
Joined: Sun Apr 16, 2006 1:18 am

Post by CrackEEr »

Can any one else help me ?


In vb the code was like
recordset.movenext
recordset.movefirst
recordset.movelast.

It worked that way.

Can anyone tell me what code i hav to write for the respt buttons to do this ?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

This is a really vague question. By "table" do you mean a table in a relational database or a table in a markup language?

What you describe sounds like pagination except with items in a table rather than pages of content. Then again it could just be JavaScript if this is simply for dynamic content on a single page.

Perhaps you could give us a little more info on what this is to be used for because there's not really alot we can say with the information we have.
CrackEEr
Forum Newbie
Posts: 4
Joined: Sun Apr 16, 2006 1:18 am

Post by CrackEEr »

Ok consider i have a list of employees which is stored in the database .

I have to show their details one by one .

By clicking the buttons (next ,previous) i show the details of the next /previous employee.
By clicking the buttons (first ,last) i show the details of the first /last employee.

I thing i have to use the SQL command fetch_row() or something.
Can anyone help me in this ???
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're describing pagination. Search around in the forum, we talk about it quite often. There's even a posted Code Snippet.
CrackEEr
Forum Newbie
Posts: 4
Joined: Sun Apr 16, 2006 1:18 am

Post by CrackEEr »

I hope u got what i m sayin.
Please help me guys .I hav to complete this part by 20th of this month.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

We understand what you want to do and we have given you direction to figure it out.

We will not do it for you just because your time table is short. That's called work. We get paid to do work.
Post Reply