i am working with php and trying something new that if user inputs "a" than all the records of name starting with "a" in employee table should be displayed...

$letter=$_POST["letter"];
sql="select * from emp where emp_name='".$letter."'* "

//is above query write and the wild character to be used is write or not
pls reply.....

Member Avatar
diafol

Maybe:

$letter=mysql_real_escape_string($_POST["letter"]);
$sql="select * from emp where emp_name LIKE '$letter%'";

i wl try it and thn reply u again....thnx for replyng...