calling an function containing an array

lechuck7

New Member
Please look at my code:\[code\]function getShopConfig(){$sql = "SELECT sc_name, sc_address, sc_phone, sc_email, sc_shipping_cost, sc_order_email, cy_symbol, sc_currency FROM kol_shop_config , kol_currency WHERE sc_currency = cy_id";$result = dbQuery($sql);$row = dbFetchAssoc($result);if ($row) { //extract($row); $shopConfig = array('name' => $row['sc_name'], 'address' => $row['sc_address'], 'phone' => $row['sc_phone'], 'email' => $row['sc_email'], 'sendOrderEmail' => $row['sc_order_email'], 'shippingCost' => $row['sc_shipping_cost'], 'currency' => $row['sc_currency']);}return $shopConfig; }\[/code\]then im calling it like,\[code\]<td colspan="4" align="right"><?php getShopConfig(); echo $shopConfig['name'];?></td>\[/code\]but nothing is being displayed.. where is the mistake?? please help.note: both are in the same page. dbQuery() and dbFetchAssoc() funtions are pre-defined and has worked properly before. if i echo it inside the function and then just call it then its working properly.thank you..
 
Back
Top