Here is the sql statement I am using to grab the data:
$sql2 = "Select scategoryid,scategory_name from subcategory where mcategoryid =\"stationery\" ";
$result2 = @mysql_query($sql2,$db)or die("Couldn't execute query2.");
while ($row = mysql_fetch_array($result2)){
$scategory_name = $row['scategory_name'];
}
Here is the array, the array I need to populate is within another array
$structure['greetings'] = array(
array(
"menu" => "",
"label" => "$scategory_name",
"link" => "index.php",
"target" => "",
),
);
I tried this but it doesn't work:
$sql2 = "Select scategoryid,scategory_name from subcategory where mcategoryid =\"stationery\" ";
$result2 = @mysql_query($sql2,$db)or die("Couldn't execute query2.");
while ($row = mysql_fetch_array($result2)){
$scategory_name = $row['scategory_name'];
$display_array .= "
array(
\"menu\" => \"\",
\"label\" => \"$scategory_name\",
\"link\" => \"index.php\",
\"target\" => \"\",
),
";
}
$structure['greetings'] = array(
$display_array
);
How should I be handling this instead?