214 quizzes found.

When writing portable database code using PDO, what is the PDO::ATTR_CASE attribute useful for?

  1. None of the above
  2. Ensuring that all columns are of a particular case when fetched
  3. Adjusting the case of a query before it is processed for compatibility reasons
  4. Controls the switch logic of how queries are processed
  5. Allows you to adjust the memory cache (or "case") for increased performance

Choose 1 answers

Consider the following PHP code segment, which attempts to execute a PDO query; In the event of a PDOException, $info is set with the contents of the $errorInfo property of the exception. Which of the following are accurate descriptions of the contents?

<?phptry { $dbh->exec($sql);} catch (PDOException $e) { // display warning message $info = $e->errorInfo;}?>
  1. $info[1] is the database-specific error code
  2. $info[2] is the database-specific error message
  3. $info[1] is the unified error code
  4. $info[0] is the unified error code
  5. $info[0] Is the Database-specific error message

Choose 3 answers

Which of the following functions allow you to introspect the call stack during execution of a PHP script?

  1. get_backtrace()
  2. get_function_stack()
  3. debug_backtrace()
  4. debug_print_backtrace()
  5. print_backtrace()

Choose 2 answers

When working with a database, which of the following can be used to mitigate the possibility of exposing your database credientials to a malicious user?

  1. Moving all database credentials into a single file
  2. Moving all database credentials outside of the document root
  3. Restricting access to files not designed to be executed independently
  4. Setting creditial information as system environment variables
  5. Using PHP constants instead of variables to store credentials

Choose 3 answers

When running PHP in a shared host environment, what is the major security concern when it comes to session data?

  1. Sessions on shared hosts are easily hijacked by outside malicious users
  2. All of the above
  3. You cannot use a custom data store in shared hosts
  4. Session data stored in the file system can be read by other scripts on the same shared host
  5. Users outside the shared host can access any site which created a session for them

Choose 1 answers