Hi
In the following code,at the 21st line, the code to print the value of the variable $cartContent is:
print_r ($cartContent);
function getCartContent()
{
$cartContent = array();
$sid = session_id();
$sql = "SELECT ct_id, ct.pd_id, ct_qty, pd_name, pd_price, pd_thumbnail, pd.cat_id
FROM tbl_cart ct, tbl_product pd, tbl_category cat
WHERE ct_session_id = '$sid' AND ct.pd_id = pd.pd_id AND cat.cat_id = pd.cat_id";
$result = dbQuery($sql);
while ($row = dbFetchAssoc($result)) {
if ($row['pd_thumbnail']) {
$row['pd_thumbnail'] = WEB_ROOT . 'images/product/' . $row['pd_thumbnail'];
} else {
$row['pd_thumbnail'] = WEB_ROOT . 'images/no-image-small.png';
}
$cartContent[] = $row;
}
print_r ($cartContent);
return $cartContent;
}
I get the output at runtime as,
When i want to see only the ct_id key and its value which is 120,ignoring all other keys and values.
what is the code for it..
thanks
phpworker