This is the extended question of THIS
I am checking an user entered id is presented in a stored array with comma operator.
i have the query like this
$sql="SELECT
vendor.id,
vendor.vendor_id AS VID,
vendor.name AS VNAME,
vendor.category,
vendor.website,
vendor.email,
vendor.phone,
vendor.locations,
vendor.products,
vendor.vat,
vendor.pan,
location.loc_id,
location.name AS locname,
items.iid,
items.name
FROM vendor
INNER JOIN location ON vendor.locations = location.loc_id,items
WHERE
items.iid IN (vendor.products) AND
items.iid='".$product."' AND
vendor.id=".$vendor;
Here vendor.products stored data in 1,3,5 format. and entered data i e $products will have single id.
Whats wrong in my query as it doenst returns any data
EDITED
I have added one more column to my items table called iid which is also of type Varchar(string), Now i stored these values in vendor.products table like this
ITM004,ITM003,ITM005
, still the query doesn't show any result :(