Consider the following table data and PHP code. What is the outcome?Table data (table name "users" with primary key "id"):id name email------- ----------- -------------------1 anna alpha@example.com2 betty beta@example.org3 clara gamma@example.net5 sue sigma@example.infoPHP code (assume the PDO connection is correctly established):$dsn = 'mysql:host=localhost;dbname=exam';$user = 'username';$pass = '********';$pdo = new PDO($dsn, $user, $pass);try {$cmd = "INSERT INTO users (id, name, email) VALUES (:id, :name, :email)";$stmt = $pdo->prepare($cmd);$stmt->bindValue('id', 1);$stmt->bindValue('name', 'anna');$stmt->bindValue('email', 'alpha@example.com');$stmt->execute();echo "Success!";} catch (PDOException $e) {echo "Failure!";throw $e;}
Answer(s): B
Consider the following table data and PHP code. What is a possible outcome?Table data (table name "users" with primary key "id"):id name email------- ----------- -------------------1 anna alpha@example.com2 betty beta@example.org3 clara gamma@example.net5 sue sigma@example.infoPHP code (assume the PDO connection is correctly established):$dsn = 'mysql:host=localhost;dbname=exam';$user = 'username';$pass = '********';$pdo = new PDO($dsn, $user, $pass);$cmd = "SELECT name, email FROM users LIMIT 1";$stmt = $pdo->prepare($cmd);$stmt->execute();$result = $stmt->fetchAll(PDO::FETCH_BOTH);$row = $result[0];
Answer(s): C
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 alpha@example.com2 betty beta@example.org3 clara gamma@example.net5 sue sigma@example.infoPHP 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', 'delta@example.com')");$pdo->begin();$pdo->exec("INSERT INTO users (id, name, email) VALUES (7, 'john', 'epsilon@example.com')");throw new Exception();} catch (Exception $e) {$pdo->rollBack();}
Answer(s): A
Given a PHP value, which sample shows how to convert the value to JSON?
Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?
Post your Comments and Discuss Zend 200-550 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the 200-550 content, but please register or login to continue.