Page 1 of 1

Help needed in PHP + MySQL

Posted: Sun Apr 16, 2006 1:21 am
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.

Posted: Sun Apr 16, 2006 1:35 am
by Benjamin
If you post your vb code, perhaps we can help you convert it.

Posted: Mon Apr 17, 2006 6:13 am
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 ?

Posted: Mon Apr 17, 2006 6:51 am
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.

Posted: Mon Apr 17, 2006 10:17 am
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 ???

Posted: Mon Apr 17, 2006 10:18 am
by feyd
You're describing pagination. Search around in the forum, we talk about it quite often. There's even a posted Code Snippet.

Posted: Mon Apr 17, 2006 10:19 am
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.

Posted: Mon Apr 17, 2006 10:34 am
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.