Post by sicilian_najdorf » Wed Jul 22, 2020 11:37 am

this don't work.

Code: Select all

$cust1= $this->db->query("SELECT * FROM oc_customer WHERE customer_id='1'");
$cust2= $this->db->query("SELECT * FROM oc_customer WHERE customer_id='2'");

$c= (object)array_merge((array) $cust1->rows, (array) $cust2->rows);


Posts

Joined
Wed Nov 23, 2016 4:13 pm

Post by paulfeakins » Wed Jul 22, 2020 6:20 pm

sicilian_najdorf wrote:
Wed Jul 22, 2020 11:37 am
this don't work.
Well I'm not surprised if your programming syntax is as bad as your grammar!

It should be "doesn't work".

And tell us what error message you get?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Cue4cheap » Mon Jul 27, 2020 1:23 am

sicilian_najdorf wrote:
Wed Jul 22, 2020 11:37 am
this don't work.

Code: Select all

$cust1= $this->db->query("SELECT * FROM oc_customer WHERE customer_id='1'");
$cust2= $this->db->query("SELECT * FROM oc_customer WHERE customer_id='2'");

$c= (object)array_merge((array) $cust1->rows, (array) $cust2->rows);
What are you actually trying to do? If it is what I think it is how about :
... WHERE customer_id ='1' OR customer_id='2';

Then you don't need to mess with array_merge.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am
Who is online

Users browsing this forum: No registered users and 8 guests