Help me in php-mysql "Next Button"

Started on the old forum in August 2011 · view the original in the archive · old links redirect here

10 replies · 855 views · started 15 years ago · 1 min read

5 participants
ohimunda Junior · 21 posts #1

Hello i have to store data in different pages having next button on them suppose i have an image gallery and i have to display 10 images in a page according to different sorting like sorted in acs or dec order or sort by name etc. I just wanna consider each image as a single item and i wanna 10 items per page. for that i am able to make next button in sorting them by their id,but i am unable to make next button in sorting according to their names... can anybody help me???? please help if you can...!!!!

joban111 Junior · 24 posts #2

use search button of this forum and search for auto index script.. may be that works fot u 🙂

mFreak Developer · 66 posts #3

in you sql use

SELECT what.u.select FROM ur.table ORDER BY ur.name.column LIMIT ur.limit

should order them by name

$("#mfreak").find(".head brain").clone();

Progress:

[|||___________________________] : 5%

Output:

Memory limit reached, unable to complete operation.

Support answer:

Try using a super uber strong mega computer to reach at least 10%.

👋

ohimunda Junior · 21 posts #4

mFreak wrote: in you sql use

SELECT what.u.select FROM ur.table ORDER BY ur.name.column LIMIT ur.limit

should order them by name

yup that's what i am using select * from tableName order by name limit $limit but how to list second page's entries??? i am not asking about how to list according to name but i wanna knoe how to arrange them with next button working fine

arnage Lead · 811 posts #5

Use $_GET on button and switch() to query.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
ohimunda Junior · 21 posts #6

arnage wrote: Use $_GET on button and switch() to query.

yea i used but what will be query??? i passes page=1 , page=2 , page=3 and so on for $_GET problem is that i wanna 10 entries in a page when page=1 it shows entries from 1-10 but how to display 11-20 for page=2 and so on that is exactly what is problem 🙁

arnage Lead · 811 posts #7

I meant another $_GET for sort, for example $sort = $_GET['sort'] and switch ($sort) { $sort ='acs' or dec ... and link page.php?page=2&$sort='.$sort.' ... and query SELECT what.u.select FROM ur.table ORDER BY '.$sort.' LIMIT ur.limit That?

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
ohimunda Junior · 21 posts #8

arnage wrote: I meant another $_GET for sort, for example $sort = $_GET['sort'] and switch ($sort) { $sort ='acs' or dec ... and link page.php?page=2&$sort='.$sort.' ... and query SELECT what.u.select FROM ur.table ORDER BY '.$sort.' LIMIT ur.limit That?

what about page.php?page=2???? how will page=2 work???

Added after 11 minutes:

arnage wrote: I meant another $_GET for sort, for example $sort = $_GET['sort'] and switch ($sort) { $sort ='acs' or dec ... and link page.php?page=2&$sort='.$sort.' ... and query SELECT what.u.select FROM ur.table ORDER BY '.$sort.' LIMIT ur.limit That?

hmmm... listen i made a similar page with next button which is working fine there i sort entries according to their "id" which is int type for that i used "select * from tableName where id > $id_of_last_entry_in_previous_page limit $limit" ok? this way if you have to arrange 10 entries per page then for page=2 id will be greater than 10 i.e., id = 11 and limit will stop at 20 for page=2 and so on.. but if i have to arrange them in a sorting order by their name then how can i get last entry of each page and how can i start next page's 1st entry exactly next from previous page's last entry?

arnage Lead · 811 posts #9

Post your code, i realy cant guess.

ohimunda wrote: ... how can i get last entry of each page and how can i start next page's 1st entry exactly next from previous page's last entry?

Thats doing math and loop.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close