NEW
Font size
WorksheetsPHP + MySQL
Total questions: 25
Worksheet time: 13mins
What does PHP stands for?
PHP: Hypertext Preprocessor
Private Home Page
Personal Hypertext Processor
Which among the following is the correct delimiters that surround PHP server scripts?
<?php>...</?>
<script>...</script>
<?php...?>
<&>...</&>
How do you get information from a form that is submitted using the "get" method?
Request.QueryString;
$_GET[];
Request.Form;
When using the POST method, variables are displayed in the URL:
True
False
What is the correct way to add 1 to the $count variable?
$count =+1
$count++;
++count
count++;
How do you create an array in PHP?
$cars = "Volvo", "BMW", "Toyota";
$cars = array["Volvo", "BMW", "Toyota"];
$cars = array("Volvo", "BMW", "Toyota");
The if statement is used to execute some code only if a specified condition is true
True
False
How is PHP written into a webpage?
Just like other html tags: <php> </php>
Only in a separate file which is linked to the html page
Using curled brackets {php} {/php}
A PHP script starts with <?php and ends with ?>
PHP script is parsed....
On the client's web browser
On the server where the website is hosted
On the client's CPU
On the Internet
PHP is case sensitive in what way?
It's never case sensitive, don't worry about it.
Only when referring to variables
When referring to classes, functions or variables
All the time!
When concatenating strings, you use what symbol in PHP?
A comma ,
A plus sign +
a hyphen -
a full stop .
Which statement can be used to select the database?
$mysqli=select_db('databasename');
mysqli=select_db('databasename');
mysqli->select_db('databasename');
$mysqli->select_db('databasename');
The updated MySQL extension with PHP5 is typically referred to as
MySQL
mysql
mysqli
mysqly
Which method returns the error code generated from the execution of the last MySQL function?
errno()
errnumber()
errorno()
errornumber()
Which one of the following methods can be used to diagnose and display info about a MySQL connection error?
connect_errno()
connect_error()
mysqli_connect_errno()
mysqli_connect_error()
Which method is responsible for sending the query to the database?
query()
send_query()
sendquery()
query_send()
Which will input data into a table?
INSERT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
INPUT INTO table(name, height, weight) VALUES('strand', '6ft 2in', '165')
INSERT INTO table CATEGORIES(name, height, weight) VALUES('strand', '6ft 2in', '165')
INSERT INTO table CATEGORIES(name, height, weight) ('strand', '6ft 2in', '165')
If I want to show all data in a MySQL table, I would use
SHOW * FROM table;
SELECT * FROM table;
SHOW * IN table;
SELECT * IN table;
