What is the significance of using quotes around placeholders in SQL statements when using PDO with MSSQL in PHP?

When using PDO with MSSQL in PHP, it is important to use quotes around placeholders in SQL statements to ensure that the values are properly escaped and quoted. This helps prevent SQL injection attacks and ensures that the query executes correctly with strings and other data types.

// Example of using quotes around placeholders in a PDO query for MSSQL
$pdo = new PDO("sqlsrv:Server=localhost;Database=mydatabase", "username", "password");

// Prepare a SQL statement with placeholders
$stmt = $pdo->prepare("SELECT * FROM mytable WHERE column1 = :value");

// Bind the parameter with proper quoting
$value = "myvalue";
$stmt->bindParam(':value', $value, PDO::PARAM_STR);

// Execute the query
$stmt->execute();

// Fetch the results
$results = $stmt->fetchAll();