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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:09:39+00:00 2026-05-28T00:09:39+00:00

This while parses my query. The $merge var contains the exact structure I need.

  • 0

This while parses my query. The $merge var contains the exact structure I need.

What I am trying to do is take the $merge data and process it as an array and get each value in a $row[0], $row[1], $row[3] etc… outside of the while loop.

while ($row = mysql_fetch_row($query)) {
    $industries = explode(",", $row[13]);
    unset($row[13]);
    $merge = array_merge($row, $industries);
}

Example of $merge output:

Array
(
   [0] => 3122
   [1] => Painting Services
   [2] => 
   [3] => 1234567 Tew Street
   [4] => 
   [5] => Andover
   [6] => MA
   [7] => 
   [8] => 01801
   [9] => 000-555-1212
   [10] => 000-555-1212
   [11] => 
   [12] => www.not-a-real-site.ooo
   [13] => Roofing 
)

Array
(
   [0] => 3123
   [1] => Hobow Corporation
   [2] => 
   [3] => 115 Sound Plaza, 117th Floor
   [4] => 
   [5] => Woodbridge
   [6] => NJ
   [7] => 
   [8] => 07111
   [9] => 000-555-1212
   [10] => 000-555-1212
   [11] => 
   [12] => www.not-a-real-site.ooo
   [13] => Energy
)
  • 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-05-28T00:09:40+00:00Added an answer on May 28, 2026 at 12:09 am
    $rows = array();
    while ($row = mysql_fetch_row($query)) {
        $industries = explode(",", $row[13]);
        unset($row[13]);
        $rows[] = array_merge($row, $industries);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one thread that is receiving data over a socket like this: while
I get this error while trying to obtain the number of shares and likes
I am trying to figure out a script to take a MySQL query and
I can only assume this is a bug. The first assert passes while the
I've run into this while writing a Traveling Salesman program. For an inner loop,
I stumbled upon this while doing a review and the author is not available:
Part of my code goes like this: while(1){ my $winmm = new Win32::MediaPlayer; $winmm->load('1.mp3');
I am building a multithreaded system that works like this: While there are entities:
I'm doing a basic homework assignment which looks like this: While input <> -1
I'm writing some code that looks like this: while(true) { switch(msg->state) { case MSGTYPE:

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.