12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 06/01/2020
Connecting PHP and MYSQL
Download Tamil Nadu 12th Standard Computer Applications question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Applications Test

1.
_______Function is used to close an existing opened database connection between PHP scripting and MySQL Database Server.
mysqli_close( )
mysqli_connect error( )
mysqli_query( )
mysqli_connect( )
2.
_______IS a function, helps to execute the SQL query statements in PHP scripting language
mysqli_closet( )
mysqlLconnect_error( )
mysqli_query( )
mysqli_connect( )
3.
Which version of PHP supports MySQLi functions ?
Version 2.0
Version 3.0
Version 4.0
Version 5.0
4.
How many parameter are required for MYSQLi query function in PHP ?
2
3
4
5
5.
which one is correct way, we can retrieve the data in the result set of MySQL using PHP?
mysql_fetch_row.
mysql_fetch_array
mysql_fetch_object
All the above
6.
How many parameters to connect to database server, in Mysqli_connect( ) Function?
7.
What is MySQLi?
8.
What is mysqli_fetch_assoc() Function?
9.
What is web Database?
10.
What are the MySQLi function available PHP?
11.
How the connection will get success in mysqli_connect( ) function?
12.
What is the use of SQL statements in PHP?
13.
Write a note PHP MySQL database connection.
14.
Differentiate mysqli_affected_rows( ) Function and mysqli_fetch_assoc( ) Function.
15.
Write the Syntax for MySQLi Queries.
16.
Write a short note on parameters of mysqli_connect( ) function?
17.
Explain MySQLi Queries with examples.
18.
Explain in details types of MySQL connection method in PHP.
19.
Discuss in detail about MySQL functions with example.
1.
(b)
mysqli_connect error( )
2.
(c)
mysqli_query( )
3.
(d)
Version 5.0
4.
(a)
2
5.
(d)
All the above
6.
This function requires four parameters to connect to database server.
7.
MySQLi is extension in PHP scripting language which gives access to the MYSQL database.
8.
1. The mysqli_fetch_assoc() function fetches a result row as an associative array .
2. Syntax
mysqIi_fetch_assoc(result);
9.
1. A Web database is a database application designed to be managed and accessed through the Internet.
2. In other words, the light databases that support the web applications are also known as Web Databases
10.
(i) Mysqli_connect() Function
(ii) Mysqli_close() Function
(iii) Mysqli_query() Function
11.
(i) The mysqll_connect function uses these variables and connect Database server from PHP scripting.
(ii) If connection gets fail, output will be printed with MySQL error code. Otherwise connection is success.
12.
The SQL query statements are helping with PHP MySQL extension to achieve the objective of MySQL and PHP connection.
13.
Database Connections: Accessing MySQL Database, connect to Database Server machine via PHP scripting language using Mysqli_connect() Function.
Syntax:
mysqli_connect("Server Name","User Name","Password","DB Name");
This function requires four parameters to connect to database server. Database Server name, Database username, password and Database Name.
14.
| mysqli_affected rows( ) | mysqli_fetch_assoc( ) |
|---|---|
| It returns the number of affected rows in the prearvious SELECT, INSERT UPDATE, REPLACE, or DELETE query. | It fetches a result rowas an associative aray |
| Return value: An integer >0 indicates the number of rows affected (0 indicates that no records were affected. '-1' indicates that the query returned an error). |
Returns an associative array of strings representing the fetched row. NULL if there are no more rows in result set. |
| Syntax: mysqli_affected_rows (connection); |
Syntax: mysqli fetch_as-soc(result); |
15.
Syntax:
mysqli_query("Connection Object","SQL Query")
16.
(i) Four Parameters are used to connect to the Database server.
(ii) They are
1.$ servername -> Database Server server IP address
2.$ susername -> Database Server User Name
3.$ password -> Database Server Password
4.$ DB_Name -> Database Name
17.
Performing Queries: The main goal of MySQL and PHP connectivity is to retrieve and manipulate the data from MySQL database server. The SQL query statements are help in PHP MySQL extension to achieve the objective of MySQL and PHP connection. “mysqli_query” is a function, that helps to execute the SQL query statements in PHP scripting language.
Syntax:
mysqli_query(“Connection Object”,“SQL Query”)
Example:
$con=mysqli_connect(“localhost”,“my_user”,“my_password”,“Student_DB”);
$sql=“SELECT student_name,student_age FROM student”;mysqli_query($con,$sql);
18.
Database Connections: Before accessing MYSQL Database, connect to Database Server machine via PHP scripting language using Mysqli_connect() Function.
Syntax:
mysqli_connect(“Server Name”,“User Name”,“Password”,“DB Name”);
This function requires four parameters to connect to database server. Database Server name, Database username, password and Database Name.
Managing Database Connections: The below code describes managing database connection methods and features.
<?php
$servername = “localhost”;
$username = “username”;
$password = “password”;
SDB_name = “School_DB”;
$conn = mysqli_connect($servername, $username, $password,$DB_name);
if(!$conn){
die(“Connection failed: “ . mysqli_connect_error( ));
}
echo “Connected successfully”;
?>
In the above code snippet, four variables are used to connect to the Database server. They are
The mysqli_connect function uses these variables and connect Database server to PHP. If connection gets fail, output will be printed with MySQL error code. Otherwise connection is success.
19.
MySQL function in PHP:
In PHP Scripting language many functions are available for MySQL Database connectivity and executing SQL queries.
MySQLi is extension in PHP scripting language which gives access to the MYSQL database. MySQLi extension was introduced version 5.0.0,
The MySQLi extension contains the following important functions which are related to MySQL database connectivity and management.
i) Mysqli_connect() Function
ii) Mysqli_close() Function
iii) Mysqli_query() Function
(i) Database Connections:
Before accessing MySQL Database, connect to Database Server machine via PHP scripting language using Mysqli_connect() Function.
Syntax :
mysqli_connect("Server Name "User Name","Password"DB Name");
This function requires four parameters to connect to database server. Database Server name, Database username, password anda Database Name.
(ii) Managing Database Connections :
The below code describes managing database connection methods and features.
The mysqli_connect function uses these variables to connect Database server to PHP. If connection gets fail, output will be printed with MySQL error code. Otherwise connection is success.
(iii) Performing Queries :
The main goal of MySQL and PHP connectivity is to retrieve and manipulate the data from MYSQL database server. The SQL query statements help in PHP MySQL extension to achieve the objective of MYSQL and PHP connection. "mysqli_query" is a function, that helps to execute the SQL query statements in PHP scripting language.
Syntax:
mysqli_query("Connection Object","SQL Query")
Example:
Closing Connection :
mysqli_close() Function is used to close an existing opened database connection between PHP scripting and MySQL Database Server.
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards