I had thought about changing it, but that would mean an extra line in the database for each category per supplier... whereas I could just append the category to the cell in the database.
I have been thinking instead (sleep does wonderful things) of using a foreach instead, and then appending it to a normal string...
something like
<?
$query=do_query("SELECT ref,category FROM suppliers");
while(list($ref,$category)=mysql_fetch_row($query))
{
$category=explode("\n",$category);
if (strlen($ref)==1)
{
$ref='0'.$ref;
}
foreach($category as $string)
{
$string=trim($string);
$array .="\"".$ref."\",\"".$string."\",\"".$string."\",";
}
$array=substr($array,0,-1);
}
echo $array;
?>
gives me what I require like so...
"01","Speakers","Speakers","01","Amps","Amps","01","Mixers","Mixers","01","Cameras","Cameras","01","Stereos","Stereos","01","Bob","Bob""02","fgsj","fgsj","02","sgkjafga","sgkjafga","02","adfgdf","adfgdf","02","gdfgdfga","gdfgdfga","02","asdfgdfggbs","asdfgdfggbs","02","searte","searte"
HOWEVER... now it is kicking up a javascript error... yet when I hard code it it works....
Any ideas on why that would happen ?