Hello
I have just learning Coldfusion ! So please , could anyone help me in this problem :
I want to know , how to seperate each records with a space when displaying the query !
This my code :

<cfquery name="getEntrees" datasource="logement">
		SELECT  TOP 5 *
		FROM Entrees
	</cfquery>

Coldfusion

<cfoutput query = "getEntrees"  >						

 					#getEntrees.Sommaire# 

</cfoutput>

What it display :

Enregistrement1Enregistrement2Enregistrement3Enregistrement4Enregistrement5

What i want :

  1. Enregistrement1
  2. Enregistrement2
  3. Enregistrement3
  4. Enregistrement4
  5. Enregistrement5

Sorry for my poor english , Im origine from France , i have just 17 year and i speak just a little bit English .
Cheers and thanks in advance for your help !

anyhelp , will be appreciated:( ! Thanks !

You need to use a html ordered list tag. Just search for html and "ol" for the syntax you need.

HI there ,
Thanks for your reply !
I think u havnt understund really my problem .. Well if we suppose , i have enter in 5 record this text :
Im
Sorry
About
that
sir
So when i want to display this in coldfusion . it display text not seperated with space .

It display :
Imsorryaboutthatsir
so the other problem , i want to see how to <br> every word ...
Like
Im
sorry
about
that
sir
....
Thanks in advance !

Hi, this is how I acheive the kind of thing your looking for:

<cfoutput query = "getEntrees"  >#Sommaire#<br/><br/></cfoutput>

if you define the query within the cfoutput tag there is no need to define it in the variable.

also you could try this :

<cfoutput query = "getEntrees"  ><ol><li>#Sommaire#</li></ol></cfoutput>

hope this helps

Thank u very very muck mate :) !! it work like a charm !! Thanks again !

Hi, this is how I acheive the kind of thing your looking for:

<cfoutput query = "getEntrees" >#Sommaire#<br/><br/></cfoutput>

if you define the query within the cfoutput tag there is no need to define it in the variable.

also you could try this :

<cfoutput query = "getEntrees" ><ol><li>#Sommaire#</li></ol></cfoutput>

hope this helps

That will work, but it brings up a separate problem in most cfml code. Improper var scoping is the bane of my existence, second only in heinousness to not cfqueryparam'ing your queries. Not scoping your variables right can cause the most difficult to fix bugs. Even though what is above will work, you should always work with the scoped query column (eg getEntrees.Sommaire).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.