Find Jobs
Hire Freelancers

Conditional MySQL/PHP query: 1 database, 2 tables

$10-30 USD

Completed
Posted over 10 years ago

$10-30 USD

Paid on delivery
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";}
Project ID: 5253929

About the project

6 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
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 in 1 day
5.0 (6 reviews)
4.4
4.4
6 freelancers are bidding on average $26 USD for this job
User Avatar
A proposal has not yet been provided
$25 USD in 1 day
5.0 (192 reviews)
6.4
6.4
User Avatar
JUST CHECK MY BADGES... There are only 4 freelancers with 100% of SQL Level3... I'm one of them... I'm waiting for your award...
$35 USD in 1 day
5.0 (35 reviews)
5.9
5.9
User Avatar
Hi There, Can be done this project now. Please share this project now and please view my profile projects reviews. Thanks
$20 USD in 0 day
4.9 (49 reviews)
4.6
4.6

About the client

Flag of UNITED KINGDOM
United Kingdom
5.0
2
Member since Jun 18, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.