Free 200-550 Exam Braindumps (page: 14)

Page 13 of 56

Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following configurations could be responsible for this outcome? (Choose 2)

  1. The PHP configuration option post_max_size is set to a value that is too small
  2. The web server is using an incorrect encoding as part of the HTTP response sent to the client
  3. The browser uses an incorrect encoding as part of the HTTP request sent to the server
  4. The hidden form field MAX_FILE_SIZE was set to a value that is too small
  5. PHP cannot process file uploads larger than 4 MB

Answer(s): A,D



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.com
2 betty beta@example.org
3 clara gamma@example.net
5 sue sigma@example.info
PHP 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 * FROM users WHERE id = :id";
$stmt = $pdo->prepare($cmd);
$id = 3;
$stmt->bindParam('id', $id);
$stmt->execute();
$stmt->bindColumn(3, $result);
$row = $stmt->fetch(PDO::FETCH_BOUND);

  1. The database will return no rows.
  2. The value of $row will be an array.
  3. The value of $result will be empty.
  4. The value of $result will be 'gamma@example.net'.

Answer(s): D



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.com
2 betty beta@example.org
3 clara gamma@example.net
5 sue sigma@example.info
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 {
$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;
}

  1. The INSERT will succeed and the user will see the "Success!" message.
  2. The INSERT will fail because of a primary key violation, and the user will see the "Success!" message.
  3. The INSERT will fail because of a primary key violation, and the user will see a PDO warning message.
  4. The INSERT will fail because of a primary key violation, and the user will see the "Failure!" message.

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.com
2 betty beta@example.org
3 clara gamma@example.net
5 sue sigma@example.info
PHP 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];

  1. The value of $row is `array(0 => 'anna', 1 => 'alpha@example.com')`.
  2. The value of $row is `array('name' => 'anna', 'email' => 'alpha@example.com')`.
  3. The value of $row is `array(0 => 'anna', 'name' => 'anna', 1 => 'alpha@example.com', 'email' => 'alpha@example.com')`.
  4. The value of $result is `array('anna' => 'alpha@example.com')`.

Answer(s): C






Post your Comments and Discuss Zend 200-550 exam with other Community members:

200-550 Discussions & Posts