ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 17th, 2005, 07:43 AM
porkchopnz porkchopnz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 porkchopnz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool Changing dynamic content on page via links

Okay, hopefully I can explain what I'm trying to do good enough so ya'll understand.

I have a cfm page with a form, users fill in the fields, submit the form and it adds the data to a access database.
So far I have another page loading every entry from the database but there are too many entries being submitted so my idea was to create links on the fly, dynamically, that would be displayed on the main page, and then only one database entry would be displayed at a time, with the user clicking the link on that page to load that particular entry.

I'm getting pretty used to submitting info to databases and displaying that information in various ways on another page but my problem here is mainly the theory as in, how to actually go about doing what I explained.
So, any advice on the kinda of process I need to implement on these pages would be appreciated.

Reply With Quote
  #2  
Old January 17th, 2005, 08:28 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
In general this sounds like it should be easy. But I'm not totally sure what you want to do. Can you post some more detail, along with maybe an example of exactly what you want to see as far as the page and the link(s)?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old January 17th, 2005, 05:54 PM
porkchopnz porkchopnz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 porkchopnz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sure, here goes.

add_history.cfm:
user completes form and on submission, form data is put into database. (historyID, historytitle, history)

display_history.cfm:
database query, then output each 'history' entry from database.
(#rsDisplayHistory.History# etc etc)

also on this page, a link is displayed for each database entry according to the 'historyID' (using the values from the database, basically the way you display anything from a database, only it would show ALL records so that you can navigate to any of the entries.

What I have hit a brick wall on, is how to go about making the links that are created based on each database record, communicate with what gets displayed on the main area of the page.

I hope that helps, if I can think of any better way to explain what I want to do, or some examples that might help, I will post it.

Thanks!

Reply With Quote
  #4  
Old January 17th, 2005, 06:17 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
Well your main page would have a query for all the records:

<cfquery name="getAllHistory" dsn="#myDSN#">
select thistoryID, historytitle, history
from historyTable
</cfquery>

And then output them all. You could make it output all the links, and make each one a link to a details page like this:

<cfoutput query="getAllHistory">
<a href="detailpage.cfm?historyid=#getAllHistory.historyID#">#getAllHistory.historyTitle#</a>
</cfoutput>

Then on the detail page you could have:

<cfquery name="getAllHistory" dsn="#myDSN#">
select thistoryID, historytitle, history
from historyTable
where historyID = '#trim( url.historyID )#'
</cfquery>

to get just that one item, and then output it. This is pretty basic stuff so if you're not familiar with it I'd recommend reading the Ben Forta book...it's how about 95% of CF developers learned CF.

Reply With Quote
  #5  
Old January 17th, 2005, 09:09 PM
porkchopnz porkchopnz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 3 porkchopnz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks very much for the help, I'll look up that book too.
One more thing though, I get a data type mismatch error if I leave the ID field as type=AutoNumber. If I change it to text the whole thing works fine.
How do I go about keeping it at AutoNumber and still working? I don't understand this part very well

Thanks

Reply With Quote
  #6  
Old January 17th, 2005, 09:16 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
replace with:

<cfquery name="getAllHistory" dsn="#myDSN#">
select thistoryID, historytitle, history
from historyTable
where historyID = #val( url.historyID )#
</cfquery>

And seriously this sort of thing (and much more) is covered in the first 50 pages of any good CF book. If things like this are unclear to you I urge you to read through one, you'll be far more productive.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Changing dynamic content on page via links


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT