PHP EXAM QUESTIONS AND ANSWERS
How many of the following statements are true for PHP operators? x+=y is the same as
x=x+y x=-y is the same as x=x-y x.=y is the same as x=x.y
1 2 or 3 - Answers -3
In PHP, a constant is set by the - Answers -define()function
t or f
In MySQL, the AND operator displays a record if ALL conditions listed are true. -
Answers -true
In PHP, ID keys in arrays are always assigned automatically. - Answers -true
How many of the following statements are true for PHP? PHP can only run on a Apache
server. PHP is a W3C standard. A PHP file has the file extension ".php". PHP scripts
are executed on the server.
1
2
3
4 - Answers -3
In MySQL, how to return all the records from a table named "Customers" sorted
REVERSE alphabetically by "FirstName"? - Answers -
t or f
In PHP, the setcookie() function must appear BEFORE the <html> tag. - Answers -
Which of the following is true for PHP variables?
Unless a data type is declared, it will be set to String as default
The data type is declared automatically when you use the variable
A variable must always be declared before being used - Answers -
What PHP function fetches a result row (from a MySQL connection) as an associative
array, a numeric array, or both? - Answers -
What PHP function is used to open a new connection to the MySQL server? - Answers
-
In MySQL, how to select all columns from a table named "Customers"?
, Group of answer choicesSELECT * CustomersSELECT * FROM CustomersSELECT
[all] FROM Customers - Answers -
In PHP, large comment blocks are defined by:
Group of answer choices<comment> and </comment>// and \\/* and */<!-- and --> -
Answers -
In PHP, a timestamp can be made with the
Group of answer choicessetdate() functionmktime() functiontimestamp() function -
Answers -
A MySQL connection in PHP will automatically close when the script ends.
Group of answer choicesTrueFalse - Answers -
Which of the following is NOT a valid variable name in PHP?
Group of answer choices$salesPerWeek$sales_per_week$sales-per-week - Answers -
All variables in PHP start with which symbol?
Group of answer choices&#$! - Answers -
In MySQL, how to select all the records from a table named "Customers" where
"FirstName" starts with an "a"?
Group of answer choicesSELECT * FROM Customers WHERE
FirstName=''a%''SELECT * FROM Customers WHERE FirstName LIKE ''a%''SELECT *
FROM Customers WHERE FirstName LIKE ''a'' - Answers -
What is the correct way to create a function in PHP?
Group of answer choicescreate myFunction()new_function myFunction()function
myFunction() - Answers -
What does PHP stand for? - Answers -PHP: Hypertext Preprocessor
In PHP, you can get the value of a constant with the
Group of answer choicesconstant() functionconstant_value() functionget_constant()
function - Answers -
In PHP, you can get the value of a constant with the - Answers -Constant () function
In MySQL, which keyword is used to sort the result?
Group of answer choicesSORT BYORDERORDER BYSORT - Answers -
How do you write "Hello World" in PHP?
Group of answer choicesResponse.Write("Hello World");output "Hello World";echo
"Hello World"; - Answers -
In MySQL, what is the proper syntax for inserting new data in a database?
How many of the following statements are true for PHP operators? x+=y is the same as
x=x+y x=-y is the same as x=x-y x.=y is the same as x=x.y
1 2 or 3 - Answers -3
In PHP, a constant is set by the - Answers -define()function
t or f
In MySQL, the AND operator displays a record if ALL conditions listed are true. -
Answers -true
In PHP, ID keys in arrays are always assigned automatically. - Answers -true
How many of the following statements are true for PHP? PHP can only run on a Apache
server. PHP is a W3C standard. A PHP file has the file extension ".php". PHP scripts
are executed on the server.
1
2
3
4 - Answers -3
In MySQL, how to return all the records from a table named "Customers" sorted
REVERSE alphabetically by "FirstName"? - Answers -
t or f
In PHP, the setcookie() function must appear BEFORE the <html> tag. - Answers -
Which of the following is true for PHP variables?
Unless a data type is declared, it will be set to String as default
The data type is declared automatically when you use the variable
A variable must always be declared before being used - Answers -
What PHP function fetches a result row (from a MySQL connection) as an associative
array, a numeric array, or both? - Answers -
What PHP function is used to open a new connection to the MySQL server? - Answers
-
In MySQL, how to select all columns from a table named "Customers"?
, Group of answer choicesSELECT * CustomersSELECT * FROM CustomersSELECT
[all] FROM Customers - Answers -
In PHP, large comment blocks are defined by:
Group of answer choices<comment> and </comment>// and \\/* and */<!-- and --> -
Answers -
In PHP, a timestamp can be made with the
Group of answer choicessetdate() functionmktime() functiontimestamp() function -
Answers -
A MySQL connection in PHP will automatically close when the script ends.
Group of answer choicesTrueFalse - Answers -
Which of the following is NOT a valid variable name in PHP?
Group of answer choices$salesPerWeek$sales_per_week$sales-per-week - Answers -
All variables in PHP start with which symbol?
Group of answer choices&#$! - Answers -
In MySQL, how to select all the records from a table named "Customers" where
"FirstName" starts with an "a"?
Group of answer choicesSELECT * FROM Customers WHERE
FirstName=''a%''SELECT * FROM Customers WHERE FirstName LIKE ''a%''SELECT *
FROM Customers WHERE FirstName LIKE ''a'' - Answers -
What is the correct way to create a function in PHP?
Group of answer choicescreate myFunction()new_function myFunction()function
myFunction() - Answers -
What does PHP stand for? - Answers -PHP: Hypertext Preprocessor
In PHP, you can get the value of a constant with the
Group of answer choicesconstant() functionconstant_value() functionget_constant()
function - Answers -
In PHP, you can get the value of a constant with the - Answers -Constant () function
In MySQL, which keyword is used to sort the result?
Group of answer choicesSORT BYORDERORDER BYSORT - Answers -
How do you write "Hello World" in PHP?
Group of answer choicesResponse.Write("Hello World");output "Hello World";echo
"Hello World"; - Answers -
In MySQL, what is the proper syntax for inserting new data in a database?