Avatar of edavo
edavo
Flag for United States of America asked on

SQL Query - return EXACT match on two parameters

What if I want to add a second parameter to my query? I understand the % but I want the both the $th and $sport vars (below) to be an exact match, not a "like"...

This works for one parameter, but needs to be modified to be EXACT EQUALS, not LIKE:
$sql="SELECT * FROM schedules WHERE team LIKE '%".$tm."%' ORDER BY date";

This is not working for two, how do I add the second parameter (they are both being passed in a URL string:
$sql="SELECT * FROM schedules WHERE team LIKE '%".$tm."%' AND sport='%".$sport."%'ORDER BY date";
PHP

Avatar of undefined
Last Comment
edavo

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Pratima

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
edavo

ASKER
This is not working - I copied and pasted it in place and the code below appears broken (color coded) --- Something in this line is breaking the code...?
edavo

ASKER
Fast Service = Happy customer - you guys are GREAT!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck