![]() |
Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes |
Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF Download: Students of class can download the Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF Download from our website. We have uploaded the Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL notes according to the latest chapters present in the syllabus. Download Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Chapter Wise Notes PDF from the links provided in this article.
Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF Download
We bring to you specially curated Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF which have been prepared by our subject experts after carefully following the trend of the exam in the last few years. The notes will not only serve for revision purposes, but also will have several cuts and easy methods to go about a difficult problem.
Board |
Tamilnadu Board |
Study Material |
Notes |
Class |
Samacheer Kalvi 12th Computer Applications |
Subject |
12th Computer Applications |
Chapter |
Chapter 9 Connecting PHP and MYSQL |
Format |
|
Provider |
How to Download Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDFs?
- Visit our website - https://www.samacheerkalvibook.com/
- Click on the Samacheer Kalvi 12th Computer Applications Notes PDF.
- Look for your preferred subject.
- Now download the Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL notes PDF.
Download Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Chapterwise Notes PDF
Students can download the Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF from the links provided in this article.
PART – I
I. Choose The Correct Answer
Question 1.
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( )
Answer:
(b) $mysqli = new mysqli( )
Question 2.
which one is correct way, we can retrieve the data in the result set of MySQL using PHP?
(a) mysql_fetch_row
(b) mysql_fetch_array
(c) mysql_fetch_object
(d) All the above
Answer:
(d) All the above
Question 3.
How Can we Create a Database Using PHP and MySQL?
(a) mysqli_create_db(“Database Name”)
(b) mysqli_create_db(“Data”)
(c) create_db(“Database Name”)
(d) create_db(“Data”)
Answer:
(a) mysqli_create_db(“Database Name”)
Question 4.
Which is the correct function to execute the SQL queries in PHP?
(a) mysqli_query(“Connection Object”,“SQL Query”)
(b) query(“Connection Object”, “SQL Query”)
(c) mysql_query(“Connection Object”,“SQL Query”)
(d) mysql_query(“SQL Query”)
Answer:
(a) mysqli_query(“Connection Object”,“SQL Query”)
Question 5.
Which is the correct function Closing Connection in PHP?
(a) mysqli_close(“Connection Object”)
(b) close(“Connection Object”);
(c) mysql_close(“Connection Object”)
(d) mysqli_close(“Database Object”);
Answer:
(a) mysqli_close(“Connection Object”)
Question 6.
Which is the correct function-to establish Connection in PHP?
(a) mysqli_connect(“Server Name”,“User Name”,“Password”,“DB Name”);
(b) connect(“Server Name”,“User Name”,“Password”,“DB Name”);
(c) mysql_connect(“Server Name”,“User Name”,“Password”,“DB Name”);
(d) mysqli connect (“Database Object”);
Answer:
(a) mysqli_connect(“Server Name”,“User Name”,“Password”,“DB Name”);
Question 7.
Which is the not a correct MySQL Function in PHP?
(a) Mysqli_connect( ) Function
(b) Mysqli_close( ) Function
(c) mysqli_Select_data( ) Function
(d) mysqli_affected_rows( ) Function
Answer:
(c) mysqli_Select_data( ) Function
Question 8.
How many parameter are required for MYSQLi connect function in PHP?
(a) 2
(b) 3
(c) 4
(d) 5
Answer:
(c) 4
Question 9.
How many parameter are required for MYSQLi query function in PHP?
(a) 2
(b) 3
(c) 4
(d) 5
Answer:
(a) 2
Question 10.
How many parameter are required for MYSQLi Close function in PHP?
(a) 1
(b) 2
(c) 3
(d) 5
Answer:
(a) 1
Question 11.
Which version of PHP supports MySQLi functions?
(a) Version 2.0
(b) Version 3.0
(c) Version 4.0
(d) Version 5.0
Answer:
(d) Version 5.0
PART – II
II. Short Answer
Question 1.
What are the MySQLi function available PHP?
Answer:
- Mysqli_connect() Function
- Mysqli_close() Function
- mysqli_select_db() Function
- mysqli_afFected_rows() Function
- mysqli_connect_error() Function
- mysqli_fetch_assoc() Function
Question 2.
What is MySQLi function?
Answer:
MySQLi functions:
- The Mysqli functions allow you to access MySQL database servers.
- For the MySQL functions to be available, you must compile PHP with support for the MySQLi extension.
Question 3.
What are the types MySQLi function available PHP?
Answer:
- Mysqli_connect() Function
- Mysqli_close() Function
- mysqli_select_db() Function
- mysqli_affected_rows() Function
- mysqli_connect_error() Function
- mysqli_fetch_assoc() Function
Question 4.
Difference between the Connection and Close function?
Answer:
Connection:
- Before accessing MySQL Database, connect to Database Server machine via PHP scripting language using Mysqli_ connect( ) Function.
- This function requires 4 parameters.
Close function:
- mysqli close( ) Function is used to close an existing opened database connection between PHP scripting and MySQL Database Server.
- This function requires only one parameter.
Question 5.
Give few examples of MySQLi Queries?
Answer:
$sql=“SELECT student_name,student_age FROM student”;mysqli_query($con,$sql); sql stmt = “SELECT * FROM my contacts”;
$result = mysqli_query($connection,$sql_stmt).
Question 6.
What is the Connection string?
Answer:
- A connection string Is a string that specifies information about a data source and the means of connecting to it.
- It is passed in code to an underlying driver or provider in order to initiate the connection.
Question 7.
What is web Database?
Answer:
Web Database:
A web database is a wide term for managing data online. A web database gives you the ability to build your own databases.
Ex. Bank, airline and rental car reservation.
Question 8.
What is mysqli_fetch_assoc( ) Function?
Answer:
The mysqli_fetch_assoc() function fetches a result row as an associative array.
Syntax
mysqli_fetch_assoc(result);
Question 9.
Define mysqli_connect_error( ) Function?
Answer:
mysqli connect_error( ):
It returns the error description from the last connection error.
Syntax:
mysqli_connect_ertror( ):
Question 10.
Define mysqii_affected_rows( ) Function?
Answer:
The mysqli_affected_rows() function returns the number of affected rows in the previous SELECT, INSERT, UPDATE, REPLACE, or DELETE query.
Syntax
mysqli_affected_rows(connection);
PART – III
III. Explain in Brief Answer
Question 1.
Write the Syntax for MySQLi Queries?
Answer:
Syntax:
mysqli_query(“Connection Object’’,“SQL Query”)
Question 2.
Write is the purpose of MySQLi function available?
Answer:
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.
- Mysqli_connect( ) Function
- Mysqli_close( ) Function
- mysqli_select_db( ) Function
- mysqli_affected_rows( ) Function
- mysqli_connect_error( ) Function
- mysqli_fetch_assoc( ) Function
Question 3.
Differentiate mysqli_affected_rows( ) Function and mysqli_fetch_assoc( ) Function?
Answer:
Fetch assoc( )
mysqli_fetch_assoc( ):
Fetches a result row as an associative array.
Syntax:
mysqli fetch_assoc(result)
Affected rows( )
my sqli_affected_ro ws( ):
mysqli affected_rows( ) returns the number of affected rows in the previous MYSQL operation.
Syntax:
mysqli_affected_rows(connection)
Question 4.
Write MySQL Connection Syntax with example?
Answer:
Syntax:
mysqli_connect(“ServerName”,”UserName”,”- Password”,”DB Name”);
Example:
$conn = mysqli_connect($dbhost, $dbuser, $dbpass);
Question 5.
Write a note PHP MySQL database connection?
Answer:
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 snippet describes managing database connection methods and features. c?php
$servername = “localhost”;
$username = “username”;
$password = “password”;
$DBname = “SchoolDB”;
// Create connection
$conn = mysqli_connect($servemame, Susername, Spassword,$DB_name).
PART – IV
IV. Explain in detail
Question 1.
Discuss in detail MySQL functions with example?
Answer:
MySQL Function in PHP:
In PHP Scripting language many functions are available for MySQL Database connectivity and executing SQL queries. MySQLi is an extension in PHP scripting language which gives access to the MYSQL database. MySQLi extension was introduced in version 5.0.0.
The MySQLi extension contains the following important functions which are related to MySQL database connectivity and management.
- Mysqli_connect( ) Function
- Mysqli_close( ) Function
- mysqli_select_db( ) Function
- mysqli_affected_rows( ) Function
- mysqli_connect_error( ) Function
- mysqli_fetch_assoc( ) Function
1. 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.
2. Managing Database Connections:
The below code snippet describes managing database connection methods and features.
<?php
$servemame = “localhost”;
$usemame = “username”;
$password = “password”;
$DB_name = “School_DB”;
// Create connection
$conn = mysqli_connect($servemame, Susemame, $password,$DB_name);
The mysqli connect function uses these variables and connect Database server from PHP scripting. If connection gets fail, output will be printed with MySQL error code. Otherwise connection is success.
3. Performing Queries:
The main goal of MySQL and PHP connectivity is to retrieve and manipulate the data from the MySQL database server. The SQL query statements are helping with PHP MySQL extension to achieve the objective of MySQL and PHP connection, “mysqliquery” is a function, 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);
4. Closing Connection:
mysqli_close( ) Function is used to close an existing opened database connection between PHP scripting and MySQL Database Server.
Question 2.
Explain the Database error handling and management process in PHP?
Answer:
Managing Database Connections:
The below code snippet describes managing database connection methods and features.
<?php
$servemame = “localhost”;
$username = “username”;
$password = “password”;
$DBname = “SchoolDB”;
// Create connection
Sconn = mysqli_connect($servemame, Susername, Spassword,SDBname);
// Check connection
if (! Sconn) {
die(“Ccnnection failed: “ . mysqli_connect_error( ));
}.
echo “Connected successfully”;
?>,
In the above code snippet, three variables are used to connect to the database server. They are
- $servemame → Database Server IP address
- $usemame → Database Server User Name
- $password → Database Server Password
- $DB_Name → Database Name
The mysqli_connect function uses these variables and connects the Database server from PHP scripting. If the connection gets fail, the output will be printed with MySQL error code. Otherwise, the connection is a success.
Question 3.
Explain in details types of MySQL connection method in PHP?
Answer:
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 snippet describes managing database connection methods and features.
<?php
$servemame = “localhost”;
$usemame = “username”;
$password = “password”;
SDB_name = “SchoolDB”;
// Create connection
$conn = mysqli_connect($servemame, Susemame, Spassword,$DB_name);
// Check connection
if(!$conn){
die(“Connection failed: “ . mysqli_connect_error( ));
}
echo “Connected successfully”;
?>
In the above code snippet, three variables are used to connect to the Database server. They are
- $servemame → Database Server Server IP address
- $username → Database Server User Name
- $password → Database Server Password
- $DBName → Database Name
The mysqli_connect function uses these variables and connect Database server from PHP scripting. If connection gets fail, output will be printed with MySQL error code. Otherwise connection is success.
Question 4.
Explain MySQLi Queries with examples?
Answer:
Definition and Usage
The mysqli_query() function performs a query against the database.
The mysqli_query function is used to execute SQL queries.
The function can be used to execute the follow¬ing query types;
- Insert
- Select
- Update
- delete
Syntax
<?php
mysqli_query($dbhandle,$query);
?>
HERE,
- “mysqli_query(…)” is the function that executes the SQL queries.
- “$query” is the SQL query to be executed
- “$link_identifier” is optional, it can be used to pass in the server connection link
Example:
- $con = mysqli_connect(“localhost”,”my_ user”,”my_password”,”Student_DB “);
- $sql=”SELECT student_name,student_age FROM student”;mysqli_query($con,$sql);
Samacheer Kalvi 12th Computer Applications Solutions Connecting PHP and MYSQL Additional Question and Answer
I. Choose The Best Answer
Question 1.
…………… is important to all computer and Internet related applications.
a) Data
b) MySQL
c) PHP
d) None of these
Answer:
a) Data
Question 2.
According to a recent survey, approximately ………………………….. websites are running using PHP.
Answer:
544 million
Question 3.
Connection to the Database Server machine via PHP scripting language using ………….Function.
a) mysqli_affected_rows()
b) mysqli_connect_error()
c) mysqli_fetch_assoc()
d) mysqli_connect()
Answer:
d) mysqli_connect()
Question 4.
Expand HPHP:
(a) W\gh Power High Power
(b) Heavy Processor Heavy Processor
(c) Hip Hop
(d) High Hop
Answer:
(c) Hip Hop
Question 5.
…………….. Function is used to close an existing opened database connection between PHP scripting and MySQL Database Server.
a) mysqli_close()
b) mysqli_connect_error()
c) mysqli_query()
d) mysqli_connect()
Answer:
b) mysqli_connect_error()
Question 6.
RAD means ………………………..
(a) Rigid Application Design
(b) Rapid Application Development
(c) Rare App Design
(d) Raster Audio Development
Answer:
(b) Rapid Application Development
Question 7.
………………………….. is a server-side scripting language designed for web development.
Answer:
PHP
Question 8.
Which is a request for data or ‘information’ from a database table?
(a) row
(b) record
(c) query
(d) report
Answer:
(c) query
Question 9.
Which is an open-source relational database management system?
(a) MySQL
(b) Foxpro
(c) MS-Access
(d) Excel
Answer:
(a) MySQL
Question 10.
Pick the odd one out.
(a) PRADO
(b) Cake
(c) cake PHP
(d) Symphony
Answer:
(b) Cake
II. Short Answer
Question 1.
Expand RDBMS.
Answer:
Relational Database Management System
Question 2.
What is the main goal of providing connectivity between MySql and PHP?
Answer:
The main goal of MySQL and PHP connectivity is to retrieve and manipulate the data from the MySQL database server.
- The SQL query statements are helping with PHP MySQL extension to achieve the objective of MySQL and PHP connection.
- “mysqli_query” is a function, helps to execute the SQL query statements in PHP scripting – language.
III. Explain in Brief Answer
Question 1.
What Is the main goal of MySQL and PHP connectivity?
Answer:
The main goal of MySQL and PHP connectivity is to retrieve and manipulate the data from the MySQL database server.
Question 2.
Name the parameters of connecting functions?
Answer:
- $servemame → Database Server Server IP address
- $username → Database Server User Name
- $password → Database Server Password
- $DBName → Database Name
Question 3.
Write a short note on the parameters of the mysqSLconnect() function.
Answer:
Four Parameters are used to connect to the Database server.
They are
- $servername -> Database Server Server IP address
- $username -> Database Server User Name
- $password -> Database Server Password
- $DB_Name -> Database Name
Question 4.
Mention some web frameworks design structures to promote rapid application development (RAD)?
Answer:
Some of these include PRADO, CakePHP, Symfony, Codeigniter, Laravel, Yii Framework, Phalcon, and Zend Framework, offering features similar to other web frameworks.
How to Prepare using Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF?
Students must prepare for the upcoming exams from Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF by following certain essential steps which are provided below.
- Use Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL notes by paying attention to facts and ideas.
- Pay attention to the important topics
- Refer TN Board books as well as the books recommended.
- Correctly follow the notes to reduce the number of questions being answered in the exam incorrectly
- Highlight and explain the concepts in details.
Samacheer Kalvi 12th Computer Applications All Chapter Notes PDF Download
- Samacheer Kalvi 12th Computer Applications Chapter 1 Multimedia and Desktop Publishing Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 1 Multimedia and Desktop Publishing Notes
- Samacheer Kalvi 12th Computer Applications Chapter 2 An Introduction to Adobe Pagemaker Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 2 An Introduction to Adobe Pagemaker Notes
- Samacheer Kalvi 12th Computer Applications Chapter 3 Introduction to Database Management System Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 3 Introduction to Database Management System Notes
- Samacheer Kalvi 12th Computer Applications Chapter 4 Introduction to Hypertext Pre-Processor Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 4 Introduction to Hypertext Pre-Processor Notes
- Samacheer Kalvi 12th Computer Applications Chapter 5 PHP Function and Array Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 5 PHP Function and Array Notes
- Samacheer Kalvi 12th Computer Applications Chapter 6 PHP Conditional Statements Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 6 PHP Conditional Statements Notes
- Samacheer Kalvi 12th Computer Applications Chapter 7 Looping Structure Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 7 Looping Structure Notes
- Samacheer Kalvi 12th Computer Applications Chapter 8 Forms and Files Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 8 Forms and Files Notes
- Samacheer Kalvi 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 9 Connecting PHP and MYSQL Notes
- Samacheer Kalvi 12th Computer Applications Chapter 10 Introduction to Computer Networks Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 10 Introduction to Computer Networks Notes
- Samacheer Kalvi 12th Computer Applications Chapter 11 Network Examples and Protocols Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 11 Network Examples and Protocols Notes
- Samacheer Kalvi 12th Computer Applications Chapter 12 DNS (Domain Name System) Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 12 DNS (Domain Name System) Notes
- Samacheer Kalvi 12th Computer Applications Chapter 13 Network Cabling Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 13 Network Cabling Notes
- Samacheer Kalvi 12th Computer Applications Chapter 14 Open Source Concepts Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 14 Open Source Concepts Notes
- Samacheer Kalvi 12th Computer Applications Chapter 15 E-Commerce Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 15 E-Commerce Notes
- Samacheer Kalvi 12th Computer Applications Chapter 16 Electronic Payment Systems Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 16 Electronic Payment Systems Notes
- Samacheer Kalvi 12th Computer Applications Chapter 17 E-Commerce Security Systems Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 17 E-Commerce Security Systems Notes
- Samacheer Kalvi 12th Computer Applications Chapter 18 Electronic Data Interchange – EDI Notes PDF Download: Tamil Nadu STD 12th Computer Applications Chapter 18 Electronic Data Interchange – EDI Notes
0 comments:
Post a Comment