wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PHP + MySQL

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What does PHP stands for?

a)

PHP: Hypertext Preprocessor

b)

Private Home Page

c)

Personal Hypertext Processor

2.

Which among the following is the correct delimiters that surround PHP server scripts?

a)

<?php>...</?>

b)

<script>...</script>

c)

<?php...?>

d)

<&>...</&>

3.

How do you get information from a form that is submitted using the "get" method?

a)

Request.QueryString;

b)

$_GET[];

c)

Request.Form;

4.

When using the POST method, variables are displayed in the URL:

a)

True

b)

False

5.

What is the correct way to add 1 to the $count variable?

a)

$count =+1

b)

$count++;

c)

++count

d)

count++;

6.

How do you create an array in PHP?

a)

$cars = "Volvo", "BMW", "Toyota";

b)

$cars = array["Volvo", "BMW", "Toyota"];

c)

$cars = array("Volvo", "BMW", "Toyota");

7.

The if statement is used to execute some code only if a specified condition is true

a)

True

b)

False

8.

How is PHP written into a webpage?

a)

Just like other html tags: <php> </php>

b)

Only in a separate file which is linked to the html page

c)

Using curled brackets {php} {/php}

d)

A PHP script starts with <?php and ends with ?>

9.

PHP script is parsed....

a)

On the client's web browser

b)

On the server where the website is hosted

c)

On the client's CPU

d)

On the Internet

10.

PHP is case sensitive in what way?

a)

It's never case sensitive, don't worry about it.

b)

Only when referring to variables

c)

When referring to classes, functions or variables

d)

All the time!

11.

When concatenating strings, you use what symbol in PHP?

a)

A comma ,

b)

A plus sign +

c)

a hyphen -

d)

a full stop .

12.

Which statement can be used to select the database?

a)

$mysqli=select_db('databasename');

b)

mysqli=select_db('databasename');

c)

mysqli->select_db('databasename');

d)

$mysqli->select_db('databasename');

13.

The updated MySQL extension with PHP5 is typically referred to as

a)

MySQL

b)

mysql

c)

mysqli

d)

mysqly

14.

Which method returns the error code generated from the execution of the last MySQL function?

a)

errno()

b)

errnumber()

c)

errorno()

d)

errornumber()

15.

Which one of the following methods can be used to diagnose and display info about a MySQL connection error?

a)

connect_errno()

b)

connect_error()

c)

mysqli_connect_errno()

d)

mysqli_connect_error()

16.

Which method is responsible for sending the query to the database?

a)

query()

b)

send_query()

c)

sendquery()

d)

query_send()

17.
How can we get the number of records or rows in a table?
a)
 Using COUNT
b)
Using NUM
c)
 Using NUMBER
d)
Both a and c above
18.
USE keyword is used to select a ____________________
a)
Table
b)
Column
c)
Database
d)
None of the above
19.
Which is the default order of sort in ORDER BY clause?
a)
Ascending
b)
Descending
20.
A relational database  ___________ is a data structure used to store and organize information.
a)
View
b)
Table
c)
Report
d)
Stored Procedure
21.
What is the maximum size of the VARCHAR Column type?
a)
255 char
b)
255 Byte
c)
512 Char
d)
512 Byte
22.
MySQL is
a)
A Programming language
b)
A technique for writing reliable programs
c)
 A Relational Database Management System
d)
None of the Above
23.
What SQL clause is used to restrict the rows returned by a query?
a)
AND
b)
WHERE
c)
HAVING
d)
FROM
24.

Which will input data into a table?

a)

INSERT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')

b)

INPUT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')

c)

INSERT INTO table CATEGORIES(name, height, weight) VALUES('strand', '6ft 2in', '165')

d)

INSERT INTO table CATEGORIES(name, height, weight) ('strand', '6ft 2in', '165')

25.

If I want to show all data in a MySQL table, I would use

a)

SHOW * FROM table;

b)

SELECT * FROM table;

c)

SHOW * IN table;

d)

SELECT * IN table;