having problem with this section of code returning an error

error Warning: Illegal string offset ‘shippingid’ in /home/webwork/public_html/cart.php on line 934

fimc_save_customer_cart is line 930

[php]func_save_customer_cart($login, $cart);

$allow_cod = func_query_first_cell(“SELECT COUNT() FROM $sql_tbl[payment_methods] WHERE active = ‘Y’ AND is_cod = ‘Y’") > 0;
$smarty->assign(“allow_cod”, $allow_cod);
$display_cod = func_query_first_cell("SELECT COUNT(
) FROM $sql_tbl[shipping] WHERE active = ‘Y’ AND is_cod = ‘Y’ AND shippingid = ‘$cart[shippingid]’”) > 0;
$smarty->assign(“display_cod”, $display_cod);
[/php]

Your variables need quotes:
[php]$sql_tbl[payment_methods]
// should be
$sql_tbl[‘payment_methods’]
// or
$sql_tbl[“payment_methods”]
// to use inside double quotes like so:
func_query_first_cell(“SELECT COUNT(*) FROM {$sql_tbl[‘payment_methods’]} WHERE active = ‘Y’ AND is_cod = ‘Y’”)
[/php]
Make sense?

Red :wink:

thanks that solve the issue

:wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service