I got stuck with a simple query which I can't figure out why isn't doing what I expect it to do. I have 3 values set on database like this:
$measure = 'kg';
$country_code = 'DE';
$weight = '5';
WEIGHT_UNIT | COUNTRIES | MAX_WEIGHT | PRICE
kg | DE,AT | 10 | 25.55
lbs | DE,AT,CH | 5 | 15.99
My PHP query looks like this:
SELECT *
FROM `article_shipping_options`
WHERE `weight_unit` = '$measure'
AND `countries` LIKE '%$country_code%'
AND `max_weight` <= '$weight'
LIMIT 1;
The result I was expecting was the row with the 25.55 price.
I know I am doing something wrong here despise my 2 days search on google...any help would be mostly appreciated :)
var_dump(10 <= 5); // return falseDESCRIBE table_nameand paste the results?QUERYatg and it says,A request to retrieve information from a database or other information system. This tag can be used to refer to SQL queries against a database (SQL-Server, Oracle, MySQL, etc.)so I added it here. The last question was a mistake.