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 8946515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:32:26+00:00 2026-06-15T12:32:26+00:00

i have a question here… i have an array from mysql like this… array(3)

  • 0

i have a question here…

i have an array from mysql like this…

array(3) {
  [0]=>
  array(4) {
    ["id"]=>
    string(1) "1"
    ["name"]=>
    string(8) "Delivery"
    ["namaShipp"]=>
    string(3) "JNE"
    ["price"]=>
    string(5) "30000"
  }
  [1]=>
  array(4) {
    ["id"]=>
    string(1) "3"
    ["name"]=>
    string(12) "Installation"
    ["namaShipp"]=>
    string(7) "Kudamas"
    ["price"]=>
    string(1) "0"
  }
  [2]=>
  array(4) {
    ["id"]=>
    string(1) "5"
    ["name"]=>
    string(12) "Installation"
    ["namaShipp"]=>
    string(5) "MTECH"
    ["price"]=>
    string(1) "0"
  }
}

and then i want output it to a simple table.. and i dont know how..
So the result is grouped by [‘name’] key.
My question is how to output that array to become like this

-----------------------------
INSTALLATION (get from ['name'])
----------------------------
MTECH - 0                <---- MTECH is get from ['namaShipp'] and 0 is from ['price']
KUDAMAS - 0

-----------------------------
DELIVERY
-----------------------------
JNE - 30000

Anybody can help please?? i will appreciate that..
i’ve just very confused about thisss…

thanks before

  • 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-15T12:32:27+00:00Added an answer on June 15, 2026 at 12:32 pm

    Something like this:

    $current=false;
    foreach($result as $item)
    {
      if($item['name']!==$current)
      {
        echo '
    ---------------------
    '.$item['name'].'
    ---------------------';
        $current=$item['name'];
       }
       echo '
    '$item['namaShipp'].' - '.$item['price'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Noob question here! I have an array with hashes that looks like this: arr
I have used this question here on stackoverflow to create a random string without
Good day, I have like 2 question here: First a background information. from the
I have copied this question here from spring forum . I have a parent
i have a question here... i have a 3 tables like this... customer idCustomer
Newbee question here - I have this method in the view controller m: -(void)
Basic question here - I have many lines of code that look something like:
C# question here.. I have a UTF-8 string that is being interpreted by a
I have a question.Here is the code! f.select(:departments,Department.all.collect{|c|[c.name,c.id]},{},:size=>10,:multiple => ture) class Emergency has many
I have seen this question here, and was wondering if the same method of

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.