Prev and Next links based on rows in database - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > ASP » Prev and Next links based on rows in database


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 07-13-2006   #1 (permalink)
destiny
Junior Member
 
Join Date: Jul 2006
Age: 38
Posts: 14
Default Prev and Next links based on rows in database

Hopefully the title gave an ok idea of what I need. So here are the specifics.

I am building a website for a firm and they have an online portfolio that showcases key projects. Some projects have pictures associated with them. If they have pictures then if you click on the title of the project it will bring up a page displaying the first picture. I need a code that will put up prev and next links if there are more images in the database.

The database is set up similar to this:
ID, name, location, image01, image02, ... , image11

Now here is where I need some help. When the title of a project is clicked 'project.asp' comes up with two paramaters: ( project.asp?id=1&p=image01 ) 'id' is the unique number of the project, and 'p' is the first picture associated with that project (the URL of the first image, stored under 'image01' in database). I need a code that will check to see if 'image02' to 'image11' have data in the row. If they do, it will display a next link to the next image ( project.asp?id=1&p=image02 ) up until there is no data in the next 'image' cell. So if there are only 5 images, it only goes to p=image05.

I think I've made my point, but if not, let me know. I can always add more information to make it clearer.

I am not versed in ASP, but I have generally been able to understand it once I've seen it and taken a close look at it. But I don't know where to start/how to code prev/next links. Any help would be appreciated.

Destiny
destiny is offline   Reply With Quote


Old 07-14-2006   #2 (permalink)
imehesz
Senior Member
 
imehesz's Avatar
 
Join Date: Jul 2006
Age: 30
Posts: 258
Default

i'd create a function which checks if there is a "next picture". let's call it check_next( pic_id )...

since in the URL you receive the id of the picture (id=1&p=image01)

you'll have to increase the image number from 01 to 02 and create a query like
select image02 from table_name where id=id_value

if you get back something ... you can put a next link out!

this is just a start though ... ;)
__________________
--
iM
imehesz is offline   Reply With Quote

Reply



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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Links Directory | Links Exchange Program zachary All Other SE's & Directories 4 09-07-2006 12:04 AM
Cookie-based Authentication: Login program Ankita Perl 0 08-19-2006 10:40 AM
Database Links aaron Programming 0 07-29-2006 04:18 PM
Looking to buy web-based business/ technology andrew General Business Issues 0 07-04-2006 06:56 PM
Nintendo based skin Daphnes Graphics & Multimedia 29 03-27-2006 11:46 PM


footer left
All times are GMT. The time now is 03:38 AM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Electricity Suppliers | Remortgaging | vShare YouTube Clone | eBay | Online Advertising

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49