Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8452013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:23:38+00:00 2026-06-10T11:23:38+00:00

I am querying my database using this code (showing part of code): In back

  • 0

I am querying my database using this code (showing part of code):

In back end I use ExpressionEngine, Matrix, Cartthrob and DataGrab

I am using MySQL and PHP to write the code

foreach($retailprices->result_array() as $row)
{
print_r($row);   

This is the result:

Array ( [row_order] => 1 [col_id_3] => 3.500 ) 
Array ( [row_order] => 2 [col_id_3] => 12.95 ) 
Array ( [row_order] => 3 [col_id_3] => 37.45 ) 

I want to extract 3.500, 12.95 and 37.45 to an array

Then I want to print them one by one
using array. Output should look like:

3.500
12.95
37.45

Please some one guide me to solve this issue.

Thank you very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:23:40+00:00Added an answer on June 10, 2026 at 11:23 am
    foreach ($row as $out) 
    {
    print "$out"."<br>";
    }  
    

    This prints the array.

    The output will be

    3.500
    12.95
    37.45
    

    Is this what you are looking for?

    EDIT :

    foreach($retailprices->result_array() as $row)
    {
     print($row[col_id_3]); // assuming col_id_3 is the column name
    }
    

    EDIT 2 :

    foreach($retailprices->result_array() as $row)
    {
     $blah=$row[col_id_3]; 
    }
    
    echo $blah[0]; // 3.500
    echo $blah[1]; // 12.95
    echo $blah[2]; // 37.45
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on this tutorial, it's about querying the mysql database by using Json
In PHP, which is quicker; using include('somefile.php') or querying a MySQL database with a
I am using an ADO .Net Entity Model for querying a MySQL database. I
I'm trying to do a simple exercise querying a database from JS using XMLHTTPrequest
i'm querying a database like this: SELECT * from Log WHERE cookieId IN (select
I currently use mysql_real_escape_string to escape a variable when querying the database to prevent
I'm having trouble querying my SQLite database using Android. I keep getting either an
I have a pulldown menu created from PHP querying a database and then using
I am using the binary version of MaxMind's GEOIPCITY database. The following code gives
I am using node.js to query a MySQL database table every 10 seconds. Using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.