Browsing database with form buttons

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
punkee
Forum Newbie
Posts: 5
Joined: Sat Aug 21, 2004 1:10 pm

Browsing database with form buttons

Post by punkee »

I would like to make a page where users can browse info in database with buttons, but have no idea how. Searched all around but didnt find anithing similar. Onclick=next row or previous row and show data into iframe.
Any help apriciated!
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

search this form for 'pagination'

this topic has been covered numerous times.

:wink:
punkee
Forum Newbie
Posts: 5
Joined: Sat Aug 21, 2004 1:10 pm

Post by punkee »

Yes that was the only thing i found, but i want to make this with form buttons not with text links
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's nearly the same thing between buttons and links...
punkee
Forum Newbie
Posts: 5
Joined: Sat Aug 21, 2004 1:10 pm

Post by punkee »

Yes but there is increment by ID by 1 and I have a base where are some records deleted and have ID's like 3,6, 7, 12,13 how to write to go tho the next row no mather the ID's???
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the exact same way you'd write a text link, have the id stored/sent to the receiving script through the link/location change through url parameters...
punkee
Forum Newbie
Posts: 5
Joined: Sat Aug 21, 2004 1:10 pm

Post by punkee »

Could you please explain more detailed, I'm a newbie
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

<input type="button" name="foo" value="next record" onclick="document.location = 'http://bar.com/your_script.php?foo=whatever+data+you+need+to+construct+the+query+again&start=3'" />
your processing script would take the data from the request string and recreate the query, adding $_GET['start'] to the limit restrictions..

that's doing it without posting.. with posting:

Code: Select all

<input type="submit" name="next" value="next record" />
to use this, your script would look for $_POST['next']



http://use.devnetwork.net/use.php?q=pagination for more details..
punkee
Forum Newbie
Posts: 5
Joined: Sat Aug 21, 2004 1:10 pm

Post by punkee »

OK... Ill try to work out litle, thanx for now :)
Post Reply