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 Answer