Database and SQL Learning Mode
Given the following table called "names" ..
pos | name | |
---|---|---|
1 | anna | anna@mail.com |
2 | betty | bettty@mail.com |
3 | clara | clara@mail.com |
and the following PDO code (Assume PDO connection is valid)
$pdo = new PDO(...);
$pdo->beginTransaction();
$pdo->query("insert into names (name, email) values ('demi,'demi@mail.com')");
$stmt = $pdo->query('select count(*) from names');
$count1 = $stmt->fetchColumn();
$pdo->rollBack();
$stmt = $pdo->query('select count(*) from names');
$count2 = $stmt->fetchColumn();
what is the value of $count2 ?
|
|
|
|