Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

help on array database records

coldfusion array records

  • Please log in to reply
2 replies to this topic

#1 mutago

mutago

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 478 posts

Posted 12 October 2011 - 08:22 PM

Good day everyone, please i can display database records as follow in coldfusion
and now i want display it using an array in coldfusion as showed below in php code any help please.
below is the working code
<cfquery name="result" datasource="mydsn">

SELECT name,age,** FROM data_record
</cfquery>
<h1><font color=green>data successfully selected</font></h1>
<cfoutput>
<b>Your Name is</b> #name#<br>
<b>Yoour age is</b> #age#<br>
</cfoutput>



Finally, in php i can do it this way

while($rows=mysql_fetch_array($result)){

?>
<b>name</b><? print $rows['name']; ?><br>
<b>Age:</b><? print $rows['age']; ?><br>
<b>**:</b><? print $rows['**']; ?><br>



  • 0

#2 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 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

Posted 13 October 2011 - 04:49 AM

PHP is using an associative array to represent the records. ColdFusion uses a loop over the query object. You access members using either #name# or #query.name#.
  • 0

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

My MineCraft server site: http://banishedwings.enjin.com/


#3 mutago

mutago

    CC Devotee

  • Senior Member
  • PipPipPipPipPipPip
  • 478 posts

Posted 13 October 2011 - 01:48 PM

thanks
  • 0





Also tagged with one or more of these keywords: coldfusion, array, records

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download