Php Objective Questions with Answers for written test exams 16

Question 16
Which of the following functions allows you to store session data in a database?

A. session_start();

B. session_set_save_handler();

C. mysql_query();

D. You cannot store session data in a database.
Answers 16


Answer B is correct.You can use session_set_save_handler() to override

PHP’s default session-handling functions and store session data any way you want.

Answer A is incorrect because session_start() only activates PHP sessions for

the current script. Answer C is incorrect because mysql_query() only executes a

query with MySQL and does not affect the behavior of PHP’s session mechanism.

Answer D is incorrect because this statement is false

  







Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---