Forum Moderators: coopster

Message Too Old, No Replies

Parse Error and I can't find it.

         

joe1182

1:19 am on Jun 22, 2005 (gmt 0)

10+ Year Member



I am receiving the message below on my web page. It is referring to the belwo script. I can't find out what it is talking about. Can anyone help me out? Thanks

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')'


'shipping_method' => ((substr($shipping_method->fields['title'], -1) == ':')? substr(strip_tags($shipping_method->fields['title']), 0, -1) : strip_tags($shipping_method->fields['title'])));

Timotheos

4:37 am on Jun 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like you have one too many ) at the end.

'shipping_method' => ((substr($shipping_method->fields['title'], -1) == ':')? substr(strip_tags($shipping_method->fields['title']), 0, -1) : strip_tags($shipping_method->fields['title']));

joe1182

11:17 am on Jun 22, 2005 (gmt 0)

10+ Year Member



Yeah I already tried that and I still get the same error. Any ideas?

Timotheos

5:29 pm on Jun 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

Yeah I take it back. I think it needs to be there. You haven't given us the full section. This is clearly an array assignment so the problem is more then likely somewhere above this line.

Tim

joe1182

5:51 pm on Jun 22, 2005 (gmt 0)

10+ Year Member



Here is the script with several lines before the problem line. See anything.


$order_total_query = "select text, value
from " . TABLE_ORDERS_TOTAL . "
where orders_id = '" . (int)$order_id . "'
and class = 'ot_total'";

$order_total = $db->Execute($order_total_query);

$shipping_method_query = "select title, value
from " . TABLE_ORDERS_TOTAL . "
where orders_id = '" . (int)$order_id . "'
and class = 'ot_shipping'";

$shipping_method = $db->Execute($shipping_method_query);

$order_status_query = "select orders_status_name
from " . TABLE_ORDERS_STATUS . "
where orders_status_id = '" . $order->fields['orders_status'] . "'
and language_id = '" . (int)$_SESSION['languages_id'] . "'";

$order_status = $db->Execute($order_status_query);

$this->info = array('currency' => $order->fields['currency'],
'currency_value' => $order->fields['currency_value'],
'payment_method' => $order->fields['payment_method'],
'payment_module_code' => $order->fields['payment_module_code'],
'shipping_method' => $order->fields['shipping_method'],
'shipping_module_code' => $order->fields['shipping_module_code'],
'coupon_code' => $order->fields['coupon_code'],
'cc_type' => $order->fields['cc_type'],
'cc_owner' => $order->fields['cc_owner'],
'cc_number' => $order->fields['cc_number'],
'cc_expires' => $order->fields['cc_expires'],
// purchaseorder start
'account_name' => $order->fields['account_name'],
'account_number' => $order->fields['account_number'],
'po_number' => $order->fields['po_number'],
// purchaseorder end
'date_purchased' => $order->fields['date_purchased'],
'orders_status' => $order_status->fields['orders_status_name'],
'last_modified' => $order->fields['last_modified'],
'total' => $order->fields['order_total'],
'tax' => $order->fields['order_tax'],
'ip_address' => $orders->fields['ip_address']
'shipping_method' => ((substr($shipping_method->fields['title'], -1) == ':')? substr(strip_tags($shipping_method->fields['title']), 0, -1) : strip_tags($shipping_method->fields['title'])));

Timotheos

5:54 pm on Jun 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, no comma after
'ip_address' => $orders->fields['ip_address']

joe1182

6:21 pm on Jun 22, 2005 (gmt 0)

10+ Year Member



That got it! Thanks

Timotheos

6:50 pm on Jun 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do that all the time ;-)