Test Series - php

Test Number 26/39

Q: In which version of PHP was MySQL Native Driver(also known as mysqlnd) introduced?
A. PHP 5.0
B. PHP 5.1
C. PHP 5.2
D. PHP 5.3
Solution: PHP required that MySQL client library be installed on the server from which PHP was communicating with MySQL, whether the MySQL server also happened to reside locally or elsewhere. PHP 5.3 removes this problem by introducing MySQL Native Driver.
Q: Which one of the following statements is used to create a table?
A. CREATE TABLE table_name (column_name column_type);
B. CREATE table_name (column_type column_name);
C. CREATE table_name (column_name column_type);
D. CREATE TABLE table_name (column_type column_name);
Solution: The example creates a table called “student” that contains five columns: SID, LastName, FirstName, Address, and City:
CREATE TABLE student (

    SID int,

    LastName varchar(255),

    FirstName varchar(255),

    Address varchar(255),

    City varchar(255)

);
Q: Which one of the following statements instantiates the mysqli class?
A. mysqli = new mysqli()
B. $mysqli = new mysqli()
C. $mysqli->new.mysqli()
D. mysqli->new.mysqli()
Solution: If you choose to interact with MySQL server using the object-oriented interface, you need to first instantiate the mysqli class via its constructor.
Q: Which one of the following methods can be used to diagnose and display information about a MySQL connection error?
A. connect_errno()
B. connect_error()
C. mysqli_connect_errno()
D. mysqli_connect_error()
Solution: The mysqli extension includes a few features that can be used to capture error messages or alternatively you can use exceptions.
Q: Which method returns the error code generated from the execution of the last MySQL function?
A. errno()
B. errnumber()
C. errorno()
D. errornumber()
Solution: Error numbers are often used in lieu of natural-language message to ease software internationalization efforts and allow for customization of error messages.
Q: If there is no error, then what will the error() method return?
A. TRUE
B. FALSE
C. Empty String
D. 0
Solution: The function error is used to deal with error handling and logging. If there is no error, then the error() method will return an empty string.

You Have Score    /6