PHP_Assignment-5
PHP_Assignment-5
4. 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()
6. 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”;
10. Which of the following function is used to check the cookie is set or not?
A) iscookie_set()
B) is_cookie_set()
C) isset()
D) is_set()
11. Is it true that the setcookie() function must be called before the HTML tag
in the PHP script?
A) Yes
B) No
12.What is the default expire time of a cookie, if not specified in the setcookie()
function?
A) 1 day
B) 1 week
C) 8 hours
D) When session expires
13.Can we modify the already created cookie in PHP?
A) Yes
B) No
16.Which one of the following databases has PHP supported almost since the
beginning?
a) Oracle Database
b) SQL
c) SQL+
d) MySQL
17. The updated MySQL extension released with PHP 5 is typically referred to
as _______________
a) MySQL
b) mysql
c) mysqli
d) mysqly
18. 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);
19. 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()
20. 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');
21. Which one of the following statements should be used to include a file?
a) #include ‘filename’;
b) include ‘filename’;
c) @include ‘filename’;
d) #include <filename>;
22. Which one of the following methods is responsible for sending the query to the
database?
a) query()
b) send_query()
c) sendquery()
d) mysqli_query()
23. 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) mysqli_affected_rows()
Long Questions