hello:
I'm pulling mysql data and want to load into an array. I getting the data in like manner:
$result = mysql_query("SELECT DISTINCT item2 FROM products");
echo "var option_array = new Array(num_of_cats);\n";
$count=1;
echo"option_array[0] = new Array(\"Please Select a Merchandise\");";
while($row = mysql_fetch_array($result))
{
echo"option_array[".$count."] = new Array(\"--select One--\",\"\",\"\");";
$count++;
}
I need my array as reflected within the echo to output like this
option_array[1] = new Array(\"-- Select One --\",\"CNN\",\"ABC News\");
for the echo, I have tried, with no luck:
echo"option_array[".$count."] = new Array(\"".$row['item2']."\");";
$count++;
Any help, please!