0

// Updating a column using PDO extenstion in PHP //

I guess the title says it all, but when I tried to update a column, the first statement or the first query actually works, but when I tried to update another column from another table, it is not now working.

Here is my query with the execution of it:

$sql = "UPDATE `verify` SET status=100 WHERE username=?";
$stmt = $conn->prepare($sql);
$stmt->execute(array($username));

if($stmt){
  $adminsql = "UPDATE `admin_info` SET status=100 WHERE username=?";
  $adminstmt = $conn->prepare($sql);
  $adminstmt->execute(array($username));

  if($adminstmt){
    echo 'Success!';
  }
}

The verify column is updated but the admin_info is not being updated since that they also have the same query.

EDIT:
I've changed the $result['username'] to $username, because it requires more code to be displayed here, and I want this to be simplified or minified, or just show a snippet of my code.

0 Answers0