splitting query data to array

Greetings all!

I need help with the following problem I’ve been handed.

I have a MYSQL database with several columns of data.

The trick is that in each column there are multiple data items, all separated by a ; (semicolon).
Need to split the items to correspond with their questions (q1 - q8, and comments) and tabulate the various responses.

Example of one of the columns, is below:

2;2;2;3;3;3;3;3;Comments:

Each of the numbers corresponds to a response from a form. The comments item is from the form also. There are several columns like this, each one with varying amounts of data.

I have pulled the data with no problem using the typical methods: “SELECT ec FROM eocs”;

Any help will be greatly appreciated.

[php]<?php

$myString = “2;2;2;3;3;3;3;3;Comments:”;

$myArray = explode(";", $myString);

echo “

”;
print_r($myArray);
echo “
\n”;[/php]

http://php.net/manual/en/function.explode.php

Sponsor our Newsletter | Privacy Policy | Terms of Service