I am trying to create javascript variable from php, this is what i want to get.
<?PHP echo "var color_name=[<?PHP echo $color_name;?>]"; //var color_name=["Green","Pink"];
<?PHP echo "var style_name=[<?PHP echo $style_name;?>]"; //var style_name=["Basic","Classic"];
this is my predefined_attributes table

this is what i have tried,
<?php
$predifined_qry = "SELECT attribute_column_name
FROM predefined_attributes
WHERE category_id=$id";
$predifined_result = mysqli_query($predifined_qry);
$columnNames = Array();
while ($predifined_result_row = mysqli_fetch_assoc($predifined_result)) {
$columnNames[] = $predifined_result_row['attribute_column_name'];
}
now i can get the attribute_column_name in an array using a foreach loop, but i dont know how to get the attribute_column_value array in a variable like this $style_name, $color_name. please help.