Solved

Outing putting a fieldname called 1?

Posted on 2001-07-31
2
124 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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