15 extra multiple-choice questions for Connecting PHP and MYSQL (12th Standard Computer Applications, Samacheer Kalvi), beyond the ones printed in the textbook — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.
Q1
Which PHP function is used to retrieve the descriptive error message from the last connection error in MySQLi?
- A. mysqli_error()
- B. mysqli_connect_error()Correct
- C. mysqli_connect_errno()
- D. mysqli_get_error()
Explanation. The function mysqli_connect_error() is used to return the descriptive error string when a database connection attempt fails.
Q2
In which year was the survey conducted that estimated approximately 544 million websites were running the PHP stack?
- A. 2015
- B. 2016
- C. 2018Correct
- D. 2020
Explanation. The textbook states that according to a survey, about 544 million websites were running the PHP stack as of January 2018.
Q3
Which alternative version of PHP or compiler did Facebook develop to turn its PHP code into native C++ code?
- A. HipHop's HPHP'cCorrect
- B. PHP-to-C++ Transpiler
- C. FaceCompiler
- D. C++ PHP Engine
Explanation. Facebook developed HipHop's HPHP'c, which helps convert PHP code into C++ to execute it more efficiently.
Q4
Which of the following is NOT listed as a PHP software framework in the textbook?
- A. Symfony
- B. Laravel
- C. PRADO
- D. DjangoCorrect
Explanation. The textbook mentions frameworks like PRADO, Symfony, and Laravel, but Django is a Python framework and not listed.
Q5
What is the purpose of the mysqli_num_rows() function in a PHP MySQLi script?
- A. To count the number of columns in a table
- B. To get the number of rows returned by a queryCorrect
- C. To fetch a specific database row
- D. To list all databases in the server
Explanation. The function mysqli_num_rows() is used to get the total number of rows returned from a database query.
Q6
Which function is used in PHP to fetch a query result row as an associative and numeric array?
- A. mysqli_fetch_array()Correct
- B. mysqli_get_row()
- C. mysqli_result_fetch()
- D. mysqli_data_seek()
Explanation. The mysqli_fetch_array() function fetches result rows from a query so they can be displayed on the client browser.
Q7
In the textbook connection script, which function is used to terminate program execution and display an error if the database connection fails?
- A. stop()
- B. die()Correct
- C. exit_connection()
- D. terminate()
Explanation. The die() function is evaluated to terminate script execution and print the connection failure error message.
Q8
Which of the following database management systems is NOT mentioned as a Relational Database Management System (RDBMS) in the textbook?
- A. Oracle
- B. IBM DB2
- C. MongoDBCorrect
- D. Microsoft SQL Server
Explanation. The textbook lists MySQL, Oracle, IBM DB2, and Microsoft SQL Server as examples of RDBMS. MongoDB is not mentioned.
Q9
Which PHP function is used to retrieve the specific error code from the last database connection attempt?
- A. mysqli_connect_error()
- B. mysqli_connect_errno()Correct
- C. mysqli_get_error_code()
- D. mysqli_connect_code()
Explanation. The mysqli_connect_errno() function returns the error code if a database connection attempt fails.
Q10
What percentage of websites are built using the combination of PHP and MySQL according to the textbook?
- A. 50%
- B. 60%
- C. 70%Correct
- D. 80%
Explanation. The textbook mentions in the points to remember section that seventy percentage of websites are built using PHP and MySQL.
Q11
In the mysqli_connect() function, which parameter represents the fourth argument in the parameter list?
- A. Server Name
- B. User Name
- C. Password
- D. Database NameCorrect
Explanation. The mysqli_connect() function takes four parameters in order: Server Name, User Name, Password, and Database Name.
Q12
Which framework mentioned in the textbook is designed to promote rapid application development (RAD) for PHP?
- A. Django
- B. Yii FrameworkCorrect
- C. Spring Boot
- D. Flask
Explanation. Yii Framework is specifically listed in the textbook as a PHP software framework that promotes rapid application development.
Q13
What is the primary purpose of the MySQLi extension introduced in PHP version 5.0.0?
- A. To design client-side web layouts
- B. To give access to the MySQL databaseCorrect
- C. To compile C++ code into HTML
- D. To manage local server configurations
Explanation. The MySQLi extension provides PHP scripts with secure and efficient access to MySQL database servers.
Q14
In the program examples of the textbook, which variable is typically used to store the connection object returned by mysqli_connect()?
- A. $servername
- B. $result
- C. $conn or $connectionCorrect
- D. $sql_stmt
Explanation. The variable $conn or $connection holds the database connection object used to execute subsequent queries.
Q15
Which SQL select query statement is assigned to the variable in the Chapter 9 practical program example to retrieve contacts?
- A. SELECT ALL FROM my_contacts
- B. SELECT * FROM my_contactsCorrect
- C. GET * FROM my_contacts
- D. FETCH * FROM my_contacts
Explanation. The practical example uses the standard SELECT star statement to fetch all records from the my_contacts database table.
About these Connecting PHP and MYSQL questions
These are the Additional multiple-choice questions for Connecting PHP and MYSQL from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Applications syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.
Frequently asked questions
How many MCQs are there in Connecting PHP and MYSQL?
This chapter has 15 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.
Are these 12th Standard Computer Applications MCQs free to practise online?
Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.
Where can I find the Connecting PHP and MYSQL book-back answers?
The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.