

MCQOPTIONS
Saved Bookmarks
This section includes 411 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
101. |
Which method retrieves each row from the prepared statement result and assigns the fields to the bound results? |
A. | get_row() |
B. | fetch_row() |
C. | fetch() |
D. | row() |
Answer» D. row() | |
102. |
Which one of the following methods is used to recuperating prepared statements resources? |
A. | end() |
B. | finish() |
C. | final() |
D. | close() |
Answer» E. | |
103. |
Which of the following methods is used to execute the statement after the parameters have been bound? |
A. | bind_param() |
B. | bind_result() |
C. | bound_param() |
D. | bound_result() |
Answer» B. bind_result() | |
104. |
Which version of MySQL introduced the prepared statements? |
A. | MySQL 4.0 |
B. | MySQL 4.1 |
C. | MySQL 4.2 |
D. | MySQL 4.3 |
Answer» C. MySQL 4.2 | |
105. |
Which one of the following method is used to retrieve the number of rows affected by an INSERT, UPDATE, or DELETE query? |
A. | num_rows() |
B. | affected_rows() |
C. | changed_rows() |
D. | new_rows() |
Answer» C. changed_rows() | |
106. |
Which of the methods are used to manage result sets using both associative and indexed arrays? |
A. | get_array() and get_row() |
B. | get_array() and get_column() |
C. | fetch_array() and fetch_row() |
D. | fetch_array() and fetch_column() |
Answer» D. fetch_array() and fetch_column() | |
107. |
Which one of the following methods recuperates any memory consumed by a result set? |
A. | destroy() |
B. | remover() |
C. | alloc() |
D. | free() |
Answer» E. | |
108. |
Which one of the following methods is responsible for sending the query to the database? |
A. | query() |
B. | send_query() |
C. | sendquery() |
D. | query_send() |
Answer» B. send_query() | |
109. |
Which one of the following statements should be used to include a file? |
A. | #include ‘filename’; |
B. | include ‘filename’; |
C. | @include ‘filename’; |
D. | #include ; |
Answer» C. @include ‘filename’; | |
110. |
If there is no error, then what will the error() method return? |
A. | TRUE |
B. | FALSE |
C. | Empty String |
D. | 0 |
Answer» D. 0 | |
111. |
Which method returns the error code generated from the execution of the last MySQL function? |
A. | errno() |
B. | errnumber() |
C. | errorno() |
D. | errornumber() |
Answer» B. errnumber() | |
112. |
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() |
Answer» D. mysqli_connect_error() | |
113. |
Which one of the following statements can be used to select the database? |
A. | $mysqli=select_db(‘databasename’); |
B. | mysqli=select_db(‘databasename’); |
C. | mysqli->select_db(‘databasename’); |
D. | $mysqli->select_db(‘databasename’); |
Answer» E. | |
114. |
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() |
Answer» C. $mysqli->new.mysqli() | |
115. |
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); |
Answer» B. CREATE table_name (column_type column_name); | |
116. |
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 |
Answer» E. | |
117. |
Which one of the following lines need to be uncommented or added in the php.ini file so as to enable mysqli extension? |
A. | extension=php_mysqli.dll |
B. | extension=mysql.dll |
C. | extension=php_mysqli.dl |
D. | extension=mysqli.dl |
Answer» B. extension=mysql.dll | |
118. |
The updated MySQL extension released with PHP 5 is typically referred to as.. |
A. | MySQL |
B. | mysql |
C. | mysqli |
D. | mysqly |
Answer» D. mysqly | |
119. |
Which one of the following databases has PHP supported almost since the beginning? |
A. | Oracle Database |
B. | SQL |
C. | SQL+ |
D. | MySQL |
Answer» E. | |
120. |
Parameter flags was added in which version of PHP? |
A. | PHP 4.0 |
B. | PHP 4.1 |
C. | PHP 4.2 |
D. | PHP 4.3 |
Answer» E. | |
121. |
Which one of the following is not a preg PHP function? |
A. | preg_match |
B. | preg_match_all |
C. | preg_matchall |
D. | preg_split |
Answer» D. preg_split | |
122. |
Which one of the following preg PHP functions is used to take a string, and put it in an array? |
A. | preg_destroy() |
B. | preg_split() |
C. | preg_unchain() |
D. | preg_divide() |
Answer» C. preg_unchain() | |
123. |
Which one of the following preg PHP function is used to do a find and replace on a string or an array? |
A. | preg_replace() |
B. | preg_find() |
C. | preg_find_replace() |
D. | preg_findre() |
Answer» B. preg_find() | |
124. |
Which one of the following functions is used to search a string? |
A. | preg_match |
B. | preg_search |
C. | preg_find |
D. | preg_found |
Answer» B. preg_search | |
125. |
What will be the output if we replace the line $num = preg_grep(“/[0-5]/”, $number); with $num = preg_grep(“/[0-5]/”, $number, PREG_GREP_INVERT);? |
A. | Array([0]=>0 [1]=>1 [2]=>two [3]=>three [4]=>four [5]=>5) |
B. | Array([2]=>two [3]=>three [4]=>four) |
C. | Array([1]=> 1) |
D. | Array([0]=>0 [5]=>5) |
Answer» C. Array([1]=> 1) | |
126. |
The developers of PHP deprecated the safe mode feature as of which PHP version. |
A. | PHP 5.1.0 |
B. | PHP 5.2.0 |
C. | PHP 5.3.0 |
D. | PHP 5.3.1 |
Answer» D. PHP 5.3.1 | |
127. |
Say I want to change the extension of a PHP file, which of the following statements should I edit to change from .php to .html in the httpd.conf file? |
A. | AddType application/x-httpd-php .php |
B. | AddType application/x-httpd-php .asp |
C. | AddType application/x-httpd-asp .php |
D. | AddType application/x-httpd-asp .asp |
Answer» B. AddType application/x-httpd-php .asp | |
128. |
Which directive should we disable to obscure the fact that PHP is being used on our server? |
A. | show_php |
B. | expose_php |
C. | print_php |
D. | info_php |
Answer» C. print_php | |
129. |
Which directive determines which degree of server details is provided if the ServerSignature directive is enabled? |
A. | ServerAddons |
B. | ServerExtra |
C. | ServerTokens |
D. | ServerDetails |
Answer» D. ServerDetails | |
130. |
Which Apache directive outputs Apache’s server version, server name, port and compile-in modules? |
A. | ServerSignature |
B. | ServerName |
C. | ServerDetails |
D. | ServerInfo |
Answer» B. ServerName | |
131. |
Suppose all web material is located within the directory /home/www. To prevent users from viewing and manipulating files such as /etc/password, which one of the following statements should you use? |
A. | open_dir = “/home/www/” |
B. | open_dir = /home/www/ |
C. | open_basedir = /home/www/ |
D. | open_basedir = “/home/www/” |
Answer» E. | |
132. |
The memory_limit is only applicable if ___ is enabled when you configure PHP. Fill in the blank. |
A. | –enable-limit |
B. | -enable-memory-limit |
C. | –enable-memory-limit |
D. | -memory-limit |
Answer» D. -memory-limit | |
133. |
What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated. |
A. | 10 |
B. | 20 |
C. | 30 |
D. | 40 |
Answer» D. 40 | |
134. |
Which one of the following statements should be used to disable the use of two classes administrator and janitor? |
A. | disable_classes = “administrator, janitor” |
B. | disable_classes = class administrator, class janitor |
C. | disable_classes = class “administrator”, class “janitor” |
D. | disable_class = class “administrator”, class “janitor” |
Answer» B. disable_classes = class administrator, class janitor | |
135. |
Which one of the following statements should be used to disable just the fopen(), and file() functions? |
A. | disable_functions = fopen(), file() |
B. | disable_functions = fopen, file |
C. | functions_disable = fopen(), file() |
D. | functions_disable = fopen, file |
Answer» C. functions_disable = fopen(), file() | |
136. |
What is the return type of session_set_save_handler() function? |
A. | boolean |
B. | integer |
C. | float |
D. | character |
Answer» B. integer | |
137. |
The session_start() function must appear.. |
A. | after the html tag |
B. | after the body tag |
C. | before the body tag |
D. | before the html tag |
Answer» E. | |
138. |
Which function is used to transform PHP’s session-handler behavior into that defined by your custom handler? |
A. | session_set_save() |
B. | session_set_save_handler() |
C. | Session_handler() |
D. | session_save_handler() |
Answer» C. Session_handler() | |
139. |
Which function effectively deletes all sessions that have expired? |
A. | session_delete() |
B. | session_destroy() |
C. | session_garbage_collect() |
D. | session_expired_delete() |
Answer» D. session_expired_delete() | |
140. |
Which parameter determines whether the old session file will also be deleted when the session ID is regenerated? |
A. | delete_old_file |
B. | delete_old_session |
C. | delete_old_session_file |
D. | delete_session_file |
Answer» C. delete_old_session_file | |
141. |
An attacker somehow obtains an unsuspecting user’s SID and then using it to impersonate the user in order to gain potentially sensitive information. This attack is known as.. |
A. | session-fixation |
B. | session-fixing |
C. | session-hijack |
D. | session-copy |
Answer» B. session-fixing | |
142. |
Which one of the following statements should you use to set the session username to Nachi? |
A. | $SESSION[‘username’] = “Nachi”; |
B. | $_SESSION[‘username’] = “Nachi”; |
C. | session_start(“nachi”); |
D. | $SESSION_START[“username”] = “Nachi”; |
Answer» C. session_start(“nachi”); | |
143. |
What will the function session_id() return is no parameter is passed? |
A. | Current Session Identification Number |
B. | Previous Session Identification Number |
C. | Last Session Identification Number |
D. | Error |
Answer» B. Previous Session Identification Number | |
144. |
Which function is used to erase all session variables stored in the current session? |
A. | session_destroy() |
B. | session_change() |
C. | session_remove() |
D. | session_unset() |
Answer» E. | |
145. |
Which one of the following function is used to start a session? |
A. | start_session() |
B. | session_start() |
C. | session_begin() |
D. | begin_session() |
Answer» C. session_begin() | |
146. |
What is the default time(in seconds) for which session data is considered valid? |
A. | 1800 |
B. | 3600 |
C. | 1440 |
D. | 1540 |
Answer» D. 1540 | |
147. |
What is the default number of seconds that cached session pages are made available before the new pages are created? |
A. | 360 |
B. | 180 |
C. | 3600 |
D. | 1800 |
Answer» C. 3600 | |
148. |
Neglecting to set which of the following cookie will result in the cookie’s domain being set to the host name of the server which generated it. |
A. | session.domain |
B. | session.path |
C. | session.cookie_path |
D. | session.cookie_domain |
Answer» E. | |
149. |
If the directive session.cookie_lifetime is set to 3600, the cookie will live until.. |
A. | 3600 sec |
B. | 3600 hrs |
C. | 3600 min |
D. | the browser is restarted |
Answer» B. 3600 hrs | |
150. |
If session.use_cookie is set to 0, this results in use of.. |
A. | Session |
B. | Cookie |
C. | URL rewriting |
D. | Nothing happens |
Answer» D. Nothing happens | |