I have these 2 tables
[Products]
ID
CompanyID,
Name,
PartNo,
IDSGroup,
ChartNo
[Company]
ID,
Name,
RegistrationNo,
RegistrationDate
I want to show these columns from tables when user search for a company name:
Company.Name, Product.Name, Product.PartNo, Product.IDSGroup
This search query let me get the CompanyID
Select Company.ID from Company WHERE Company.Name LIKE "$userSearch%"
Now I want to use Company.ID for this query to get all product
Select * from Products WHERE CompanyID = "id from previous query"