Sail E0 Webinar

MCQs

Total Questions : 20 | Page 2 of 2 pages
Question 11. Which one of the following statements can be used to select the database?
  1.    $mysqli=select_db('databasename');
  2.    mysqli=select_db('databasename');
  3.    mysqli->select_db('databasename');
  4.    $mysqli->select_db('databasename');
 Discuss Question
Answer: Option D. -> $mysqli->select_db('databasename');


$mysqli->select_db('databasename');


Question 12. Which one of the following statements instantiates the mysqli class?
  1.    mysqli = new mysqli()
  2.    $mysqli = new mysqli()
  3.    $mysqli->new.mysqli()
  4.    mysqli->new.mysqli()
 Discuss Question
Answer: Option B. -> $mysqli = new mysqli()


If you choose to interact with MySQL server using the object-oriented interface, you need to first instantiate the mysqli class via its constructor.


Question 13. Which one of the following methods can be used to diagnose and display information about a MySQL connection error?
  1.    connect_errno()
  2.    connect_error()
  3.    mysqli_connect_errno()
  4.    mysqli_connect_error()
 Discuss Question
Answer: Option C. -> mysqli_connect_errno()


The mysqli extension includes a few features that can be used to capture error messages or alternatively you can use exceptions.


Question 14. Which method returns the error code generated from the execution of the last MySQL function?
  1.    errno()
  2.    errnumber()
  3.    errorno()
  4.    errornumber()
 Discuss Question
Answer: Option A. -> errno()


Error numbers are often used in lieu of natural-language message to ease software internationalization efforts and allow for customization of error messages.


Question 15. If there is no error, then what will the error() method return?
  1.    TRUE
  2.    FALSE
  3.    Empty String
  4.    0
 Discuss Question
Answer: Option C. -> Empty String


Empty String


Question 16. Which of the following methods is used to execute the statement after the parameters have been bound?
  1.    bind_param()
  2.    bind_result()
  3.    bound_param()
  4.    bound_result()
 Discuss Question
Answer: Option A. -> bind_param()


Once the statement has been prepared, it needs to be executed. Exactly when it's executed depends upon whether you want to work with bound parameters or bound results. In the case of bound parameters, you'd execute the statement after the parameters have been bound with the bind_param() method.


Question 17. Which version of MySQL introduced the prepared statements?
  1.    MySQL 4.0
  2.    MySQL 4.1
  3.    MySQL 4.2
  4.    MySQL 4.3
 Discuss Question
Answer: Option B. -> MySQL 4.1


When the query() method is looped repeatedly it comes at a cost of both overhead, because of the need to repeatedly parsing of the almost identical query for validity, and coding convenience, because of the need to repeatedly reconfigure the query using the new values for each iteration. To help resolve the issues incurred by repeatedly executed queries, MySQL introduced prepared statements.


Question 18. Which method retrieves each row from the prepared statement result and assigns the fields to the bound results?
  1.    get_row()
  2.    fetch_row()
  3.    fetch()
  4.    row()
 Discuss Question
Answer: Option C. -> fetch()


Its prototype follows:class mysqli{boolean fetch()}


Question 19. Which one of the following methods is used to recuperating prepared statements resources?
  1.    end()
  2.    finish()
  3.    final()
  4.    close()
 Discuss Question
Answer: Option D. -> close()


Once you've finished using a prepared statement, the resources it requires can be recuperated with the close() method.


Question 20. Which method rolls back the present transaction?
  1.    commit()
  2.    undo()
  3.    back()
  4.    rollback()
 Discuss Question
Answer: Option D. -> rollback()


Its prototype follows:class mysqli{boolean rollback()}


Latest Videos

Latest Test Papers