ok now im getting somewhere.. seems that escaping the string was killing the \r\n
heres what i have now, although it seems to still not be working quite right
$explodest= explode("\n",$stencils);
//split amount from stencil numbers
foreach($explodest AS $lines){
list($samnt,$snumbers) = explode('x', $lines);
//echo"".$explodest[0]."<br>"; //outputs 1x1,2,3
echo"".$samnt." x ";
//explode stencil list
$explode2= explode(',',$snumbers);
//loop through all stencils
foreach($explode2 AS $sn){
$stencilsdb1=mysql_query("SELECT catnum FROM $venuedb WHERE vennum='$sn'");
$row1=mysql_fetch_array($stencilsdb1);
echo"".$row1['catnum'].",";
}
echo"<br>";
}
This results in....
1 x 1 ,2 ,,
2 x 4 ,5 ,,
3 x 7 ,8 ,9 ,
This isnt making a lot of sense to me..
If i blank out the mysql query and echo out $sn like you did I am getting correct results also!
(note: i changed the \r\n to just \n ...)