NEW
Font size
WorksheetsWeekly Test 4
Total questions: 30
Worksheet time: 15mins
Which tag is used for php
<?php
?>
<style>
<php ?>
<php
/php>
In php the keyword to be used before function name is
Function
Static
function
FUNCTION
function add()
{
$a=10;
echo $a;}
This is an example for
Call by value
Call by reference
None
Both
$a="deepan";
$b="Deepan";
if(strcmp($a,$b))
{
echo "equal";
}
else{
echo " not equal";}
Output is
Equal
Not equal
Error
None
Which one of the following is a form element?
text box.
radio button.
submit button.
All of these.
What is the output of the PHP code.
<?php
if(4>5)
{ print("Hurray.."); }
else
{ print("yes"); }
?>
Yes
hurray..yes
Hurray..Yes
none of the above
What type of language is PHP
Client Side
Server Side
Browser Side
Web Side
We create re-usable code blocks by placing them inside?
Variables
Parameters
Code Blocks
Functions
Sometimes we only want certain code to execute if a condition is true. How do we test for that?
Loop
If Statement
Integer
Variable
What is a integer?
It's a Whole Number
It's a Decimal Number
It's a True or False Declaration
It's a String of Text
What is a String?
Text
Number
True
Loop
What is a Boolean
It's Just Text
It's a Number
It's Just True
It's True or False
What if we want a block of code to execute several times?
Use a Variable
Use a Function
Use a Loop
Use a Leap
$colours = array("black, blue, Red, Green") - How do I access "Red" ?
$colours[0];
$colours[2];
$colours[1]
$colours[3];
How do I print out the values of the variable "name" ?
$name;
include $name;
echo $name;
echo $name
Which of the following is not a component of CRUD?
Create
Read
Update
Drop
Which MySQL command is used to create a new table
CREATE DATABASE
CREATE TABLE
INSERT INTO
SELECT
Which of the following is used to establish a connection to a MySQL database?
mysqli_connect()
mysql_connect()
pdo_connect()
sql_connect()
Which of the following is used to close a connection to a MySQL database?
mysqli_close()
mysql_close()
pdo_close()
sql_close()
Which of the following is used to retrieve the number of rows in a result set?
mysqli_num_rows()
mysql_num_rows()
pdo_num_rows()
sql_num_rows()
Which of the following is used to retrieve the error message associated with the last MySQL operation?
mysqli_error()
mysql_error()
pdo_error()
sql_error()
What is PHP?
PHP: Hyperlink Preprocessor
PHP: Hypertext Preprocessor
PHP: Hyperactive Preprocessor
What software that you need to make PHP project?
NetBeans & C++
NetBeans & XAMPP
Java & XAMPP
Where is your PHP project file located?
C:\xampp\htdocs\
C:\xampp\project\
D:\xampp\htdocs\
The 2 basic ways to get output in PHP are __________.
echo and cout
echo and scan
echo and print
The MySQLi extension, the 'i' stands for __________.
impress
improved
initial
What is the step to create database?
Open localhost/phpmyadmin/
Open NetBeans/New Project/
Open browser/Notepad++
Can PHP read html and CSS file?
YES
NO
MAYBE
XAMPP stand for ________.
Cross-Platform, Apache, MySQL, PHP, and Perl
Unix, Apache, MySQL, PHP, and Python
Cross-Platform, Apache, MySQL, PHP, and Python
In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
True
False
