Code: Select all
$sql_search="select a.*,b.*,c.* from users as a,students as b, cm_countries as c where (a.login like '%".$search."%' or a.name like '%".$search."%' or a.mail like '%".$search."%' or a.city like '%".$search."%') or (c.country like '%".$search."%'and a.country=c.country_id) and a.id=b.student_id and user_type!=1 and b.teacher_id=$userid";
please let me know whats wrong with this query ...