POD Prepared Statement Error



My prepared statement for update is outputting ​ before the echo statement.

Here is my code


try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    // set the PDO error mode to exception

    // prepare sql and bind parameters
    $stmt = $conn->prepare("UPDATE test SET name=:name WHERE scode=:scode");
    $stmt->bindParam(':name', $name);  
    $stmt->bindParam(':scode', $scode);

    // Update a row
    $name = $_POST['name'];
	$scode = $_POST['scode'];
 //Print the received data:
  print "Name updated to <br/>
		  <stronge>$name</stronge>" ; 	
catch(PDOException $e) {
    echo "Error: " . $e->getMessage();
$conn = null;

Here is the output

​ Name updated to
My Name

Can someone help me determine why this is happening? I am new to PHP so sorry if this is a simple fix. I am been working on it for a day and nothing I do seems to fix the issue.

Thanks in advance for your help.


Is there some reason you are throwing obsolete mysql code in the middle of PDO Code? Perhaps you should take a minute and study this tutorial https://phpdelusions.net/pdo