EbrahemSamer
2 months ago
136
2
General

Why PDO insert Query executed two times ?

Posted 2 months ago by EbrahemSamer

I am inserting using this code

////////////////

$action_name = "بحث"; $action_doer_id = $_SESSION['user_id'];

$query = "INSERT INTO transactions (transaction_name, transaction_user_id, transaction_notes) VALUES ('$action_name', $action_doer_id, '$notes')";
$stmt = $pdo->query($query);
$stmt->execute();

//////////////

the result is two records added in database why ? ( note ) but there is a query before it should i call it query2 instead of query and stmt2 instead of stmt

Please sign in or create an account to participate in this conversation.