PHP Exam Questions with Complete and
Correct 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 - Answer-3
In PHP, a constant is set by the - Answer-define()function
t or f
In MySQL, the AND operator displays a record if ALL conditions listed are true. - Answer-true
In PHP, ID keys in arrays are always assigned automatically. - Answer-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 - Answer-3
In MySQL, how to return all the records from a table named "Customers" sorted REVERSE alphabetically
by "FirstName"? - Answer-
t or f
In PHP, the setcookie() function must appear BEFORE the <html> tag. - Answer-
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 - Answer-
What PHP function fetches a result row (from a MySQL connection) as an associative array, a numeric
array, or both? - Answer-
What PHP function is used to open a new connection to the MySQL server? - Answer-
In MySQL, how to select all columns from a table named "Customers"?
Group of answer choicesSELECT * CustomersSELECT * FROM CustomersSELECT [all] FROM Customers -
Answer-
Correct 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 - Answer-3
In PHP, a constant is set by the - Answer-define()function
t or f
In MySQL, the AND operator displays a record if ALL conditions listed are true. - Answer-true
In PHP, ID keys in arrays are always assigned automatically. - Answer-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 - Answer-3
In MySQL, how to return all the records from a table named "Customers" sorted REVERSE alphabetically
by "FirstName"? - Answer-
t or f
In PHP, the setcookie() function must appear BEFORE the <html> tag. - Answer-
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 - Answer-
What PHP function fetches a result row (from a MySQL connection) as an associative array, a numeric
array, or both? - Answer-
What PHP function is used to open a new connection to the MySQL server? - Answer-
In MySQL, how to select all columns from a table named "Customers"?
Group of answer choicesSELECT * CustomersSELECT * FROM CustomersSELECT [all] FROM Customers -
Answer-