Solved

Outing putting a fieldname called 1?

Posted on 2001-07-31
2
126 Views
Last Modified: 2013-12-24
I have a field name called 1(one) from a table called users.  It is a number.  When I output it, it generates an error.  Is there a way round this?

Code :

<cfquery name="test" datasource="test">
select 1
from users
</cfquery>

*<cfoutput query="test">#1#</cfoutput>???

This part with the asterix(*) generates an error.

0
Comment
Question by:nashbubble
2 Comments
 

Accepted Solution

by:
PatrikMueller earned 50 total points
ID: 6339451
Hi,

in the SQL command "select 1 from users" the 1 is interpreted as a value not as a field name.
You have to specify a field name.

Try to use this command:
Select 1 as fieldname from users

<cfOutput query="test">#fieldname#</cfOutput>

Bye
Patrik
0
 

Author Comment

by:nashbubble
ID: 6339495
thank you it works just fine
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Remove Index.php in Codeigniter 12 71
URL redirect 4 69
System Analysis 5 64
move expression web site to a new server 13 71
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question