Solved

Outing putting a fieldname called 1?

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now