mr_ash
04-30-2006, 03:52 PM
Hi,
I am in need of some serious help here. I am having problems in creating some funtions that will gather categories from my DB:
The function that I have done to do this is:
function get_categories()
{
$conn = mysql_connect('', '', '');
mysql_select_db('', $conn);
$query = "select product_category from PRODUCT_CATEGORY";
$result = @$conn->query($query);
if (!$result)
return false;
$num_cats = @$result->num_rows;
if ($num_cats ==0)
return false;
$result = db_result_to_array($result);
return $result;
}
The problem also lies where I cant get PHP to convert these into an array can anyone help me to construct a function that will put my results into an array and then display them as a link.
I am in need of some serious help here. I am having problems in creating some funtions that will gather categories from my DB:
The function that I have done to do this is:
function get_categories()
{
$conn = mysql_connect('', '', '');
mysql_select_db('', $conn);
$query = "select product_category from PRODUCT_CATEGORY";
$result = @$conn->query($query);
if (!$result)
return false;
$num_cats = @$result->num_rows;
if ($num_cats ==0)
return false;
$result = db_result_to_array($result);
return $result;
}
The problem also lies where I cant get PHP to convert these into an array can anyone help me to construct a function that will put my results into an array and then display them as a link.
