Why it's not working?
<?php include_once("../conexao.php"); include_once("../check_session.php"); $username = $_SESSION["username"]; $profileimage = $username.'.png'; //var $conexao_pdo $sql1 = "SELECT * FROM user WHERE username = :usr"; //db column and value $stmt1 = $conexao_pdo->prepare($sql1); //where clause $stmt1->bindParam(':usr', $username); $stmt1->execute(); while ($linha = $stmt1->fetch(PDO::FETCH_OBJ)) { //echo $linha->name . ' - ' . $linha->email; $col_name = $linha->name; $col_surname = $linha->surname; $col_description = $linha->description; } $stringsize = strlen($_POST['profiledescription']); if(empty($_POST['loginname'])){$name = $col_name; } else { $name = $_POST['loginname']; } if(empty($_POST['loginsurname'])){$surname = $col_surname; } else { $surname = $_POST['loginsurname']; } if(!empty($_POST['profiledescription']&&($stringsize <= 150))){$description = $_POST['profiledescription']; } else { $description = $col_description; } //UPDATE PDO EXAMPLE $sql = "UPDATE user SET name = :name, surname = :surname, description = :description WHERE username = :username"; //db column and value $stmt = $conexao_pdo->prepare($sql); //where clause $stmt->bindParam(':username', $username); //add vars to db $stmt->bindParam(':name', $name); $stmt->bindParam(':surname', $surname); $stmt->bindParam(':description', $description); $stmt->execute(); //sucess echo "<span style='color: green;' class='fa fa-check fa-3x' aria-hidden='true'></span> "; ?>