I am new to web development (php/html/sql) so I am trying to learn by example. I have decided to write a simple php script that reads a mysql table and renders it to HTML. This HTML is echoed back to a jquery function that will display the html into a div.
This ALL works fine and as expected.
Now what I am trying to do is to have a table with a maximum of 20 rows in it and if the sql query returns 60 rows then I need to see 1 table of 20 rows on my website and an index (1,2,3...) below that table and by clicking those number I would see the extra results.
Any idea how I can achieve this? any tutorials? idea?
The solution I'm thinking of is the folowing:
in my php script I check the numbers of rows returned by mysql query then i create multiple "20 rows tables" (so if mysql returned 60 rows then I will render 3 x 20rows tables). then I put those tables into an array and I echo this. Now jquery will receive this array and render only the first table in the div.
But then my problem is that how can I have the rest of the data? so that when someone clicks on "2" below the table he can see the rest of the results?
Ahh! I hope I was clear.
Thank you!