Ask a Question related to Coldfusion Database Access, Design and Development.
-
quiero mas #1
dynamic text revisted
Just cant seem to get to the next step
Dans advice
If your database supports substrings, do this on the first page
select distinct substr(sympton, 1, 1) firstletter
from symptons
<cfoutput query="q1">
<a href="page2?letter=#firstletter#">#firstletter#
Then on page2, do this
select symptom from symptoms
where symptom like '#url.firstletter%#'
Hi ive tried everything i can think of - fiddle and modified this n that.
The error i kep getting is to do with substr
Im using access as my database
Table name: symptoms
fields
symptom_ID, firstletter, symptom
1 A Ache, Back
*symptomsearch page code
<cfquery name="q1" datasource="symptom">
select distinct substr(symptom, 1, 1) firstletter
from symptoms
</cfquery>
<html>
<head>
<title>Untitled Document</title>
</head>
<cfoutput query="q1">
<a href="ResultSymptom?letter=#firstletter#">#firstle tter#
<a href="ResultSymptom.cfm">A</a> <a href="ResultSymptom.cfm">B</a> <a
href="ResultSymptom.cfm">C</a> </cfoutput>
</html>
#as you can see i have made each letter a hyperlink to the Resultsymptom page
*Result symptom page code
<cfparam name="FORM.firstletter" default="1">
<cfparam name="PageNum_q3" default="1">
<cfquery name="q2" datasource="symptom">
SELECT firstletter
FROM symptoms
</cfquery>
<cfquery name="q3" datasource="symptom">
select symptom
from symptoms
where symptom like '#url.firstletter%#'
</cfquery>
</head>
<input type="checkbox" name="checkbox" value="checkbox">
<cfoutput>#q3.symptom#</cfoutput>
</html>
No doubt i have missed something important.
Regards Mark
quiero mas Guest
-
load external text to dynamic text field in levels
Dear Sir I found the Tech Noe Index #16238 is useful in creating dynamically loaded text from external text file. However, the method mentioned... -
Dynamic text box within dynamic movie clip
I'm having a similar problem. On mine I noticed that although the text doesn't show and the border doesn't show, the cursor changes appropriately... -
How to center text in dynamic HTML text field ???
In Flash MX 2004 I suddenly find myself comletely helpless trying to align all text to the center in my dynamic text field. I dont recall running... -
Dynamic text fields. Continuing text over columns
Hi I'm doing a mock up news paper article over 4 columns in flash mx and the text loads in dynamically. I have 4 dynamic text boxes sitting side... -
Dynamic Text Loaded from Text files -> Flash 5 <-
I was wondering how I can dynamically load text into a text box from a text file using Flash 5. I've seen plenty infos how to do it with Flash MX but... -
Dan Bracuk #2
Re: dynamic text revisted
Your problem is here:
where symptom like '#url.firstletter%#'
Put the percentage sign after the 2nd octothorp.
On your search page, you have too much code when displaying your hyperlinks.
After this line:
<a href="ResultSymptom?letter=#firstletter#">#firstle tter#
put in your closing tags for the anchor and cfoutput.
Dan Bracuk Guest
-
quiero mas #3
Re: dynamic text revisted
?????????????????????????????????????????????????? ??????????????????????????????
?
Sorry Dan still getting this
Query error - 'substr(symptom, 1, 1) firstletter'
Page 1
<cfquery name="q1" datasource="symptom">
select distinct substr(symptom, 1, 1) firstletter
from symptoms
</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<cfoutput query="q1">
<a href="ResultSymptom?letter=#firstletter#">#firstle tter#
<A> <B> <C>
</cfoutput>
</body>
</html>
Page 2
<cfparam name="FORM.firstletter" default="1">
<cfparam name="PageNum_q3" default="1">
<cfquery name="q2" datasource="symptom">
SELECT firstletter
FROM symptoms
</cfquery>
<cfquery name="q3" datasource="symptom">
select symptom
from symptoms
where symptom like '#url.firstletter#%'
</cfquery>
<html>
<head>
<title>ResultSymptom</title>
<style type="text/css">
<!--
.style1 {color: #FF6600}
-->
</style>
</head>
<input type="checkbox" name="checkbox" value="checkbox">
<cfoutput>#q3.symptom#</cfoutput>
</html>
quiero mas Guest
-
zoeski80 #4
Re: dynamic text revisted
Should it be like this ??
select distinct substr(symptom, 1, 1) AS firstletter
zoeski80 Guest
-
MikerRoo #5
Re: dynamic text revisted
Weren't you using (horrors) MS Access? :D
If so then the subtring function is not called that.
Use:
<cfquery name="q1" datasource="symptom">
select distinct mid (symptom, 1, 1) AS firstletter
from symptoms
order by mid (symptom, 1, 1)
</cfquery>
or better yet:
<cfquery name="q1" datasource="symptom">
select distinct left (symptom, 1) AS firstletter
from symptoms
order by left (symptom, 1)
</cfquery>
MikerRoo Guest
-
quiero mas #6
Re: dynamic text revisted
???????everyone - yeah horrors access thats right - im going to get onto mysql
- in the very near future - good idea?
How is the learning curve? I m the kind of person who takes a while to learn
something but that doesnt give once i started
Any advice in this area - what database to choose etc -
Regards
quiero mas Guest
-
MikerRoo #7
Re: dynamic text revisted
Is this question answered or not?
Anyway, Access is actually a good platform to learn on if you ask yourself why
the wizards and analyzer tools do what they do and recommend what they
recommend.
The best DB question is a highly charged "religeous" question -- best suited
for another post.
MikerRoo Guest
-
quiero mas #8
Re: dynamic text revisted
Not quite answered sorry mikeroo (u an aussie?)
1. on the select page
the A to Z appears and is clickable thank you
2. unfortunately when u click on a letter the message unknown page
3. On the result page if i preview it in the browser i get a message to the
effect (since my os is in Japanese)
that there is some kind if problem with first letter and url.
the codes
first page
<cfquery name="q1" datasource="symptom">
select distinct left (symptom, 1) AS firstletter
from symptoms
order by left (symptom, 1)
</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
</head>
<cfoutput query="q1">
<a href="ResultSymptom?letter=#firstletter#">#firstle tter#
</cfoutput>
</html>
next page
<cfparam name="FORM.firstletter" default="1">
<cfparam name="PageNum_q3" default="1">
<cfquery name="q2" datasource="symptom">
SELECT firstletter
FROM symptoms
</cfquery>
<cfquery name="q3" datasource="symptom">
select symptom
from symptoms
where symptom like '#url.firstletter#%'
</cfquery>
</head>
<input type="checkbox" name="checkbox" value="checkbox">
<cfoutput>#q3.symptom#</cfoutput>
quiero mas Guest
-
MikerRoo #9
Re: dynamic text revisted
Not an Australian. Just an idiot who often works Aussie (or more precisely,
Indian) hours.
On the first page, shouldn't this:
<a href="ResultSymptom?letter=#firstletter#">#firstle tter#
be this:
<a href="ResultSymptom.cfm?firstletter=#firstletter#" >#firstletter#</a>
On the next page:
Delete query "q2" and change this:
<cfparam name="FORM.firstletter" default="1">
to this:
<cfparam name="URL.firstletter" default="Z">
MikerRoo Guest
-
quiero mas #10
Re: dynamic text revisted
Thanks alot to both Dan and MIkeroo fpr all their help on this problem
It is working well
Regards Mark
quiero mas Guest



Reply With Quote

