mysql - Query where row contains a variable's data -
probably easy i've searched high , low answer no joy.
say have data in table called 'brand'
--------------------------------------- id | brand_name | brand_image | --------------------------------------- 1 | sony | sonypic | --------------------------------------- 2 | samsung | samsungpic | --------------------------------------- 3 | panasonic | panapic | --------------------------------------- i want select row table 'brand_name' appears @ beginning of variable.
eg. $variable = sony walkman
i've done million queries checking see if variable in column never done 1 checking column in variable. possible?
assuming use prepared statement:
select * brand ? concat(brand_name, '%')
Comments
Post a Comment