There are 2 tables:
sales_promotion
category_description
If a category ID exists in the sales promotion table (e.g.: 65) then I want this to be cross referenced with the category_description and if the category description matches a predefined string text string (in this example we will use $predefinedtext = "Childrens Mugs") then echo true.
So you will for example need to reformat the sample data shown below in the sales_promotion table where this section ""category";a:2:{i:0;s:2:"65";i:1;s:2:"68";" contains the relevant category ID's.
Attached are the tables I am working from.
a:28:{s:15:"sales_promotion";a:1:{i:1;a:1:{s:4:"name";s:7:"£2 Off";}}s:4:"type";s:1:"F";s:8:"discount";s:1:"2";s:13:"quantity_type";s:1:"P";s:13:"quantity_sale";s:1:"0";s:12:"quantity_buy";s:1:"0";s:14:"quantity_total";s:1:"0";s:5:"total";s:1:"0";s:6:"logged";s:1:"0";s:8:"shipping";s:1:"0";s:14:"coupon_combine";s:1:"0";s:10:"uses_total";s:4:"1000";s:13:"uses_customer";s:4:"1000";s:15:"special_combine";s:1:"1";s:16:"discount_combine";s:1:"1";s:7:"product";a:0:{}s:11:"product_buy";a:0:{}s:5:"store";a:1:{i:0;s:1:"0";}s:14:"customer_group";a:1:{i:0;s:1:"1";}s:8:"currency";a:1:{i:0;s:1:"1";}s:8:"language";a:1:{i:0;s:1:"1";}s:3:"day";a:7:{i:0;s:6:"Monday";i:1;s:7:"Tuesday";i:2;s:9:"Wednesday";i:3;s:8:"Thursday";i:4;s:6:"Friday";i:5;s:8:"Saturday";i:6;s:6:"Sunday";}s:8:"category";a:2:{i:0;s:2:"65";i:1;s:2:"68";}s:12:"manufacturer";a:0:{}s:12:"category_buy";a:0:{}s:16:"manufacturer_buy";a:0:{}s:12:"product_type";s:1:"0";s:16:"product_buy_type";s:1:"0";}
Dear Sir,
You want something like:
select category_id, case when [login to view URL] like 'condition' then true else false end as flag from category_description a inner join sales_promotion b
on a.category_id=b.category_id
Wishing you the best,
Ionut Rosca
$25 USD σε 1 ημέρα
5,0 (6 αξιολογήσεις)
4,4
4,4
6 freelancers δίνουν μια μέση προσφορά $26 USD για αυτή τη δουλειά