I'm creating a search engine that will search on keyword as well as state. I'm having a problem making the below line of code work. Can someone tell me what I'm doing wrong?
$query="SELECT * FROM $tablename[$i] WHERE name = '%$keyword%' AND state = '$selectedstate'";