wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz 1 - ITEDEV - Final

Total questions: 25

Worksheet time: 20mins

Name
Class
Date
1.
What is the correct PHP function to connect to a MySQL database?
a)
mysql_connect()
b)
connect_mysql()
c)
mysqli_connect()
d)
db_connect()
e)
pdo_connect()
2.
Which superglobal is used to collect form data after submitting an HTML form with method='post'?
a)
$_GET
b)
$_REQUEST
c)
$_POST
d)
$_SESSION
e)
$_FORM
3.
Which PHP function is used to execute a SQL query?
a)
mysqli_fetch()
b)
mysqli_query()
c)
execute_sql()
d)
run_query()
e)
query_db()
4.
Which HTML tag is used to create a form in PHP?
a)
<table>
b)
<div>
c)
<input>
d)
<form>
e)
<submit>
5.
Which attribute specifies where to send the form data?
a)
method
b)
action
c)
name
d)
target
e)
destination
6.
What will the following code output: echo 5 . '5';
a)
55
b)
10
c)
Error
d)
5.5
e)
NULL
7.
Which SQL command is used to retrieve data from a table?
a)
GET
b)
FETCH
c)
RETRIEVE
d)
SELECT
e)
SHOW
8.
What is the correct PHP function to connect to a MySQL database?
a)
mysql_connect()
b)
connect_mysql()
c)
mysqli_connect()
d)
db_connect()
e)
pdo_connect()
9.
Which superglobal is used to collect form data after submitting an HTML form with method='post'?
a)
$_GET
b)
$_REQUEST
c)
$_POST
d)
$_SESSION
e)
$_FORM
10.
Which SQL statement is used to insert new data in a database?
a)
INSERT INTO
b)
ADD DATA
c)
NEW RECORD
d)
UPDATE
e)
PUT DATA
11.
Which PHP function is used to execute a SQL query?
a)
mysqli_fetch()
b)
mysqli_query()
c)
execute_sql()
d)
run_query()
e)
query_db()
12.
Which HTML tag is used to create a form in PHP?
a)
<table>
b)
<div>
c)
<input>
d)
<form>
e)
<submit>
13.
Which attribute specifies where to send the form data?
a)
method
b)
action
c)
name
d)
target
e)
destination
14.
Which PHP function is used to start a session?
a)
start_session()
b)
session_begin()
c)
session_start()
d)
open_session()
e)
begin_session()
15.
What is the correct way to access a session variable named 'user'?
a)
$_SESSION(user)
b)
$_SESSION[user]
c)
$SESSION['user']
d)
$_SESSION['user']
e)
$_GET['user']
16.
PHP is a client-side scripting language.
a)
True
b)
False
17.
HTML forms cannot interact with PHP scripts.
a)
True
b)
False
18.
mysqli_query() can be used to both read and write to the database.
a)
True
b)
False
19.
The 'name' attribute in form inputs is required to retrieve form data in PHP.
a)
True
b)
False
20.
In PHP, a session automatically starts when the user opens a page.
a)
True
b)
False
21.
PHP is a client-side scripting language.
a)
True
b)
False
22.
HTML forms cannot interact with PHP scripts.
a)
True
b)
False
23.
mysqli_query() can be used to both read and write to the database.
a)
True
b)
False
24.
The 'name' attribute in form inputs is required to retrieve form data in PHP.
a)
True
b)
False
25.
In PHP, a session automatically starts when the user opens a page.
a)
True
b)
False