Current location: Hot Scripts Forums » Programming Languages » PHP » detail data, with next previous record


detail data, with next previous record

Reply
  #1 (permalink)  
Old 12-30-03, 01:25 AM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Question detail data, with next previous record

need a script.
i have a table in mysql
id | name | email | address | job
1 | agnes | agnes@aha.com | new york | accounting
3 | jose | jose@bla.com | california | manager
5 | robert | robert@xxx.com | new jersey | IT

display query page :
1. agnes (link to detail)
2. jose (link to detail)
3. robert (link to detail)

when i click link above(ex: jose), display detail data for jose

name : jose (jose@bla.com)
address : california
job : manager
<< previous (agnes) || next (robert) >>

also when i click link robert, display detail data for robert
name : robert (robert@xxx.com)
address : new jersey
job : IT
<< previous (jose) || next (agnes) >>

help me..
Reply With Quote
  #2 (permalink)  
Old 12-30-03, 04:26 AM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
this is pretty basic php coding, instead of asking here you might want to try this yourself and get a bit better at php. I'll give you some pointers:

there are two files:

overview.php
details.php

overview.php should only get the id and name of the person from the database, then link to details.php and pass on the id... something like details.php?id=1

then details.php should retrieve all information from the database for that one id.

the previous and next links are a bit more tricky. you'll need to find out the previous id and the next id, then retrieve the name for those id's from the database and create the links.
Reply With Quote
  #3 (permalink)  
Old 12-30-03, 06:40 PM
ivan's Avatar
ivan ivan is offline
Newbie Coder
 
Join Date: Jul 2003
Location: malang-indonesia
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
make previous id and next id in details

name : jose (jose@bla.com)
address : california
job : manager
<< previous (agnes) || next (robert) >>
agnes with id=1 and robert with id=5

how to make previous id and the next id, then retrieve the name for those id's from the database and create the links.
thanks for reply.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem getting data from DataGrid on update petersza ASP.NET 5 10-19-04 11:37 PM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM
Print data by date perleo PHP 2 08-09-03 09:35 AM
cannot display the complete data najmun PHP 2 07-04-03 02:52 PM


All times are GMT -5. The time now is 07:48 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.