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: 05/09/2022
QB365 provides a detailed and simple solution for every Possible Creative Questions in Class 12 Computer Applications Subject -Connecting PHP and MYSQL, English Medium. It will help Students to get more practice questions, Students can Practice these question papers in addition to score best marks.
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.
Write PHP data objects (PDO) program.
2.
Write a MySQLi procedural program.
3.
Explain in detail about mysqli _fetch_assco() function with syntax and give an example.
4.
What is MySQL? Explain it in detail.
5.
Write a short note on parameters of mysqli_connect( ) function?
6.
Explain the Database error handling and management process in PHP?
1.
\(\$\)servername = "localhost";
\(\$\)username = "username";
\(\$\)password - "password";
try {
\(\$\)conn = new PDO ("mysq:host = \(\$\)servername; dbname = my DB", \(\$\)username, \(\$\)password);
//set the PDO error mode to exception
\(\$\) conn -> set Attribute (PDO:: ATTR_ERRMODE, PDO:: ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch (PDO Exception \(\$\)e)
{
echo "Connection failed; " .\(\$\)e - > get message ();
}
?>
2.
\(\$\)servername = "localhost";
\(\$\)username ="username";
\(\$\)password = "password";
//Create connection
\(\$\)conn = mysqli ($servername, \(\$\)username, \(\$\)password);
// Check connection
if (!\(\$\)conn) {
die ("connection failed :".mysqli_connect_error());}
echo "Connected successfully";
?>
3.
The mysqli_fetch_assoc() function fetches a result row as an associative array.
Field name returned from this function are case-sensitive.
Syntax:
Mysqli_fetch_assoc(result) ;
Here,
(i) Result set specifies that a identifier which is returned by mysqli_query(), mysqli_store_result() or mysqli_use_result( ).
(ii) It returns an associative array of strings representing the fetched row.
(iii) NULL if there are no more rows in result set.
Example:
\(\$\)con = mysqli_connect("local host", "my_user", "my_psw'", my_db");
// check connection
if ( mysqli_connect_error () )
{
echo "fail to connect to mySQL:" . mysqli_connect_error();
}
\(\$\)sqd = "SELECT Lastname, Age FROM Persons ORDER BY Lastname";
\(\$\)result = mysqli-query(\(\$\)con, \(\$\)sql) ;
// Associative array
\(\$\) row = mysqli_fetch-assoc (\(\$\) result);
printf ("%s (%s) \n", \(\$\)row ["last name"], \(\$\)row ["Age"]);
//free result set
mysqli_free_result ($ result) ;
mysqli_close ($con);
?>
4.
MySQL is a database system used on the web.
(i) It is a database system that runs on a server.
(ii) It is ideal for both small and large applications.
(iii) It is very fast, reliable and easy to use.
(iv) It uses standard SQL.
(v) It compiles on a member of platforms.
(vi) It is free to download and use.
(vii) It is developed, distributed and supported by Oracle Corporation.
(viii) It is named after co-founder Monty Widenius's daughter.
(ix) The data in a MySQL database are stored in tables.
(x) A table is a collection of related data, and it consists of columns & rows.
(xi) Databases are useful for storing information categorically.
5.
(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
6.
Error handling is the process of catching errors raised by our program and then taking appropriate action.
Different error handling methods are
Simple "die ()" statements;
Custom error and error triggers;
Error reporting.
(i) Using the die () function:-
Example:
$file = fopen("Welcome.txt", "r");
?>
Above example shows a simple script that opens a text file. If the file does not exists you might get an error like this.
Warning:
fopen (welcome.txt) [function.fopen]: failed to open stream: No such file or directory in
C:\webfolder\test.php on line 2
To prevent the user from getting an error message like the one above, test whether the file before we
try to access it.
if (!file_exists ("welcome.txt"))
{
die ("File not found");
} else
{
file = fopen ("Welcome.txt", "r");
}
Now if the file does not exists you get an error like this
File not found
The code above is more efficient than the earlier code, because it uses a simple error handling mechanism to stop the script after the error.
However, simply stopping the script is not always the right way to go. Let's take a look at alternative php functions for handling errors.
(ii) Creating a custom Error Handler
Creating a custom error handler is quite simple. Simply create a special function that can be called when an error occurs in PHP.
This function must be able to handle a minimum of two parameters (error level and error message) but can accept up to five parameters.
Syntax:
error_function (error_level, error_message, error_file, error_line, error_context)
(iii) Error report levels:
These error report levels are the different types of error the user defined error handler can be used for:
E_WARNING, E_NOTICE, E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE,... etc.
Set Error Handler:
The default error handling for PHP is the built-in error handle;
Example:
To use our custom error handle for all errors:
set_error_handler("Custom Error");
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