CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 56: 200-550: Zend Certified PHP Engineer

Consider the following table data and PHP code, and assume that the database supports transactions. What is the outcome?Table data (table name "users" with primary key "id"):id name email------- ----------- -------------------1 anna [email protected]2 betty [email protected]3 clara [email protected]5 sue [email protec…

Nội dung câu hỏi

Consider the following table data and PHP code, and assume that the database supports transactions. What is the outcome?Table data (table name "users" with primary key "id"):id name email------- ----------- -------------------1 anna [email protected]2 betty [email protected]3 clara [email protected]5 sue [email protected]PHP code (assume the PDO connection is correctly established):$dsn = 'mysql:host=localhost;dbname=exam';$user = 'username';$pass = '********';$pdo = new PDO($dsn, $user, $pass);try {$pdo->exec("INSERT INTO users (id, name, email) VALUES (6, 'bill', '[email protected]')");$pdo->begin();$pdo->exec("INSERT INTO users (id, name, email) VALUES (7, 'john', '[email protected]')"); throw new Exception();} catch (Exception $e) {$pdo->rollBack();}

Các lựa chọn

Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.

  1. A. The user 'bill' will be inserted, but the user 'john' will not be. — đáp án hiện tại
  2. B. Both user 'bill' and user 'john' will be inserted.
  3. C. Neither user 'bill' nor user 'john' will be inserted.
  4. D. The user 'bill' will not be inserted, but the user 'john' will be.

Cộng đồng

0 bình luận công khai. Tên thành viên được ẩn một phần.

Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.

Câu hỏi liền kề