$sql.=" LEFT JOIN{$this->imgTbl}AS I ON (I.product_id = P.id AND I.id = (SELECT MAX(id) FROM product_images WHERE product_id=P.id)) "; if(array_key_exists("where",$conditions)){ $sql.=" WHERE "; $i=0; foreach($conditions['where'] as$key=>$value){ $pre= ($i>0...
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the ear...
1 SIMPLE sp ALL NULL NULL NULL NULL 6211 Using where 1 SIMPLE s eq_ref PRIMARY PRIMARY 4 erp_billing.sp.salesorder_id 1 1 SIMPLE emp eq_ref PRIMARY PRIMARY 4 erp_billing.s.entryby 1 Using where 1 SIMPLE l eq_ref PRIMARY PRIMARY 4 erp_billing.s.loc 1 Using where 1 SIMPLE pro ALL...
. This explains the behavior you saw where the last item checked in order was the only one to return what you expected. As for yourelsestatement, I am not sure what your intent was. By having a pre-populated$dbEntryarray with zeros as values, you already have an 'else' condition ...