MYSQL statement "LIKE"

wxdqz

New Member
Dear all,

In php, I want to search the variable from the column "sch_name" of the table "school_info, where $ssch_name is the input from the client, The statement is given by

$sql="select * from school_info where sch_name LIKE '%$ssch_name%'order by sch_id";

The statement is correct, but the search cannot work except that the input variable $ssch_name is exactly the same as the data from the column sch_name, Anyway, I want to search the variable just similar, not the exactly the same. Please give me some solution,thanks

Sincerely yours,
Simon
 
Back
Top