Hi Alex
Glad to hear that you got it sorted
Your solution seems to suggest that you have got a cfsetting
enablecfoutput=yes being used somewhere in the code (perhaps in an
application.cfm/cfc page ? ) and that that is why you need to the
cfoutput to get your html tags to render
Hi all
Thanks for all your clarifications with all the testing and the cfdumps you
suggested I resolved everything with that with a cfoutput after the cfif
and another at the cfelse... Just got the idea with the code that Rich
suggested earlier and with the cfdump after the cfif and cfelse
hi everybody i have this code that checks if the recordcount of the query is
not equal to 0 it gives me the list if not on the cfelse it should give me a
message but it just doesn't the list is blank...
thanks so much just trying to for hours but couldn't just get what i want
CFIF
Alex
That code seems to work ok ... I am not sure I understand exactly what
your problem is ... I am getting a link if there are records from the
query and a message if there isn't any records
Can you explain more about what your poblem is?
Rich
On 10/27/06, alex poyaoan [EMAIL PROTECTED]
Alex
That code seems to work ok ... I am not sure I understand exactly what
your problem is ... I am getting a link if there are records from the
query and a message if there isn't any records
Can you explain more about what your poblem is?
Rich
On 10/27/06, alex poyaoan [EMAIL PROTECTED]
Hmm I am not sure I fully understand...at the moment your code will
output 'no risorce' in place of any links when there are no records
returned. Is this what you want?
This is what is happening for me
On 10/27/06, alex poyaoan [EMAIL PROTECTED] wrote:
Alex
That code seems to work ok ... I
Hmm I am not sure I fully understand...at the moment your code will
output 'no risorce' in place of any links when there are no records
returned. Is this what you want?
This is what is happening for me
On 10/27/06, alex poyaoan [EMAIL PROTECTED] wrote:
yes that is what i want but what is
Hmm I am a little stumped
The only things that I can think of:
- are you using Cfsetting enablecfoutput=yes anywhere ? try
wrapping the text in cfoutput tags - although I don't think that it
is this otherwise your links wouldn't output whent there are records
- some kind of CSS overide ? seems
Hmm I am a little stumped
The only things that I can think of:
- are you using Cfsetting enablecfoutput=yes anywhere ? try
wrapping the text in cfoutput tags - although I don't think that it
is this otherwise your links wouldn't output whent there are records
- some kind of CSS overide ? seems
Alex
Have you tested if the code is definitely dropping to the 'else'
condition when there are no records being retrieved
- try out putting the recordcount to make sure you know what you are
getting back from the query or dumping the contents before the
conditional block
- on the else
Alex
Have you tested if the code is definitely dropping to the 'else'
condition when there are no records being retrieved
- try out putting the recordcount to make sure you know what you are
getting back from the query or dumping the contents before the
conditional block
- on the else
Alex
Have you tested if the code is definitely dropping to the 'else'
condition when there are no records being retrieved
- try out putting the recordcount to make sure you know what you are
getting back from the query or dumping the contents before the
conditional block
- on the else
If a CFQUERY returns no records it does not exist so there is no way to test
for zero records as no result is produced.
You need to tackle it along the lines of:
cfif MyQuery.RecordCount
Yes a result was made - ColdFusion has results ready to be handled.
cfelse
Na da. No response from the
If a CFQUERY returns no records it does not exist so there is no way
to test for zero records as no result is produced.
You need to tackle it along the lines of:
cfif MyQuery.RecordCount
Yes a result was made - ColdFusion has results ready to be handled.
cfelse
Na da. No response
On 10/27/06, Peter Tilbrook [EMAIL PROTECTED] wrote:
If a CFQUERY returns no records it does not exist so there is no way to test
for zero records as no result is produced.
That's incorrect:
cfquery datasource=myDS name=QTest
SELECT *
FROM sometable
WHERE 1=0
/cfquery
On 10/27/06, Peter Tilbrook [EMAIL PROTECTED] wrote:
If a CFQUERY returns no records it does not exist so there is no way
to test for zero records as no result is produced.
That's incorrect:
cfquery datasource=myDS name=QTest
SELECT *
FROM sometable
WHERE 1=0
Peter are you quite sure about that?
You are saying a query object will not exist from a query that returns
no records?
Try running a query with no records and dumping the query object? Does
it complain of not existing or display an empty recordset? I think
you'll find it is the latter
Your
Basically he is saying that you need not use a comparison operator with
..recordCount. I have tried your code the way you have written it and all is
good though. I would say that your problem lies in what is being output by
your database. I am thinking you have a problem with hidden characters
No that's not it, 0 translates to false in CF.
So if myQuery.recordcount is 0, then cfif myQuery.recordcount would
return false.
My suspicion is that you have somewhere in your code a cfsetting
enablecfoutputonly=yes. Is the code you posted earlier the actual
code, or is it just an example?
Hmm I did raise that point earlier Mingo but Alex says he isn't ...
unless like you say it is being set elsewhere
Alex you may want to add cfsetting enablecfoutput=no just
before this code to check this
or alternatively... the cfoutputpno risorse/p/cfoutput should
override this
ok... to try
Hmm I disagree on both accounts I Doug
- Peter was saying that the syntax was invalid and not fit for the
situation not just that you don't need an operator - which isn't true
- it seems from what Alex is saying that he is dropping in to the else
condition as he seems to be suggesting there
If a CFQUERY returns no records it does not exist
This is not true, If a CFQUERY returns no records, the query exists and
have all columns set to empty strings.
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
cfif query.recordcount
Claude Schneegans wrote:
If a CFQUERY returns no records it does not exist
This is not true, If a CFQUERY returns no records, the query exists and
have all columns set to empty strings.
~|
23 matches
Mail list logo