Empowering Students with AI-Powered Assessments & Intelligent Learning
Chapter Exam

Chapter 9: Connecting PHP and MYSQL — Online MCQ Test

COMPUTER APPLICATIONS · CLASS 12th · Tamil Nadu State Board

Practice Chapter 9: Connecting PHP and MYSQL with a free chapter-wise online MCQ test for Tamil Nadu State Board CLASS 12th COMPUTER APPLICATIONS. This chapter covers: This chapter covers database connectivity using PHP and MySQL. Students learn to establish server connections select databases execute SQL queries process database recordsets and c.... AI-generated questions from basic to board-exam level, with instant results and explanations.

10
Questions
20m
Time Limit
3
Attempts Left
  • 10 random questions from this chapter (mixed difficulty)
  • Questions you've seen before won't repeat until the pool resets
  • You have 20 minutes — exam auto-submits when time is up
  • Maximum 3 attempts per chapter
  • Results and explanations shown immediately after submission
Login to Start This Exam →

New here? Register free — includes 3 free chapter exams.

Chapter 9: Connecting PHP and MYSQL — Important Questions & Answers (FAQ)

Frequently asked questions from Tamil Nadu State Board CLASS 12th COMPUTER APPLICATIONS — Chapter 9: Connecting PHP and MYSQL, with answers and explanations. These are sample questions; the exam has its own separate question set.

Which PHP function is commonly used to establish a connection with a MySQL database server?
  • A. mysqli_connect() ✓
  • B. mysql_select_db()
  • C. mysqli_query()
  • D. mysqli_close()
Answer: A. mysqli_connect()
The mysqli_connect() function is used to connect PHP with the MySQL server by providing host, username, password, and database details.
Which function is used to select a database after connecting to the MySQL server?
  • A. mysqli_connect()
  • B. mysqli_select_db() ✓
  • C. mysqli_fetch_array()
  • D. mysqli_close()
Answer: B. mysqli_select_db()
mysqli_select_db() selects the required database on the connected MySQL server for further operations.
Which SQL statement is usually used to retrieve records from a MySQL table?
  • A. INSERT
  • B. SELECT ✓
  • C. UPDATE
  • D. DELETE
Answer: B. SELECT
SELECT is used to fetch data from one or more tables in a database.
A student wants to display all employees whose salary is greater than 50000. Which SQL query is most suitable?
  • A. SELECT * FROM employee WHERE salary > 50000; ✓
  • B. INSERT INTO employee VALUES (salary > 50000);
  • C. UPDATE employee SET salary > 50000;
  • D. DELETE FROM employee WHERE salary > 50000;
Answer: A. SELECT * FROM employee WHERE salary > 50000;
A SELECT query with a WHERE condition is used to retrieve specific records that satisfy the condition.
Which statement about mysqli_connect() is correct?
  • A. It both connects to the server and selects the database automatically in all cases
  • B. It is used to establish a connection between PHP and MySQL server ✓
  • C. It is used only to fetch records from a table
  • D. It closes the database connection after query execution
Answer: B. It is used to establish a connection between PHP and MySQL server
mysqli_connect() creates the connection between PHP and the MySQL server. Database selection and query execution are separate steps.

Choose Your Plan & Start Practising

All plans cover every subject and chapter of your registered grade.

Free
₹0
3 exams · 1 year
Start Free →
Active
₹350
12 exams · 1 year
Get Active →
Pro
₹899
Unlimited exams · 1 year
Get Pro →
NEET
₹999
Unlimited exams · 1 year
Get NEET →

Compare all plans in detail →