Interview Question in Sql Server 2000


 

Interview Question :: PHP and MS-SQL: How to prevent SQL injection

I use PHP and Microsoft SQL Server 2000 to build dymanic pages. Assume I have code like this:

$id = $_POST['id'];
$query = "select * from employees where id = '$id'";
$result = mssql_query($query);

Is this safe from SQL injection?
If not, how to prevent it?
by ksk