I dont know if this is possible:
SELECT * FROM stuff WHERE barcode = '123123' OR product like '%123123%'
Lets say this returns 10 rows. Two out of the 10 rows got returned because they had 123123 in barcode.
Now is it possible somehow to make a alias/variable to know that it comes because the it matched the barcode.
So i can do:
if($MatchWasFromBarcode) {.... }
Or will i have to make 2 queries for this?
Don’t do
select *. Bad practice. List the columns you need.