Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ajax Script

Status
Not open for further replies.

Marine1969

IS-IT--Management
Mar 5, 2015
60
0
0
US
I have an ajax script that has an Inner Join and I would like to search on 2 different fields. The issue should be on the execute line however I am not sure how to implement it. The fields I need to search on are from products.name (which is what it currently is) and clientvendors.producer. How do I modify this to pull from both fields?

Code:
$str = $conn->prepare("Select clientvendors.producer, products.name "
                    . "From products Inner Join clientvendors On clientvendors.idcv = products.idcv "
                    . "Where products.idclient=2 and name Like :name Order By clientvendors.producer, products.name");
$str->execute([':name' => "%{$_GET['term']}%"]);
$select = $str->fetchAll();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top