I've managed to have a working code with this
if ($kurs){
            $search_str .= $search_str ? ' AND ': 'WHERE' ;
            $search_str .= "`tblalumni`.`course` LIKE '%" .$kurs."%' "; 
        }
As you can see it's just have one variable, I would like to have a SQL BETWEEN Operator within two variable
here it is but it is not working
if ($year1)AND($year2){
            $search_str .= $search_str ? ' AND ': 'WHERE' ;
            $search_str .= "`tblalumni`.`yeargrad` BETWEEN '%" .$year1."%' AND '%" .$year2."%' "; 
        }
This is the error
Parse error: syntax error, unexpected 'AND' (T_LOGICAL_AND) in C:\xampp\htdocs\new1v2\admin\alumni_search_list.php on line 40
Please help me T_T
 
    