Jump to content

How to print query from database in ColdFusion

- - - - -

  • Please log in to reply
3 replies to this topic

#1
mutago

mutago

    Programmer

  • Members
  • PipPipPipPip
  • 101 posts
Good day everyone, am trying to get the value of my product price and print it from database
but I couldn't in coldfusion. I can only do it in php.
below is the work thanks

<cfset price=0>



<cfquery name="testing" datasource="mydsn">

SELECT price FROM product;

</cfquery>



<cfoutput><b>Your price is</b>#price#<br>

</cfoutput> 



#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,822 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
<cfset price=0>
<cfquery name="testing" datasource="mydsn">
 SELECT price FROM product;
 </cfquery>

<cfoutput>
<b>Your price is</b>#testing.price#<br>
 </cfoutput>

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
mutago

mutago

    Programmer

  • Members
  • PipPipPipPip
  • 101 posts
Thanks, you are the greatest

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,822 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
ColdFusion is one of the languages I get paid to work with :) It's kind of rare to see someone learning it.

ColdFusion has a few concepts that are kind of different from other languages, but you'll get it.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users