Study online at https://quizlet.com/_cea78p
1. PHP is ____ when it comes to function names (whereas 2
variable name is case-sensitive).
1) case-sensitive
2) case-insensitive
3) case-independent
4) case-contextual
2. A variable defined within a function, including a func- 2
tion's arguments, is said to have _____ scope.
1) global
2) local or function
3) file
4) block
3. Constants differ from variables in that they _____. 4
1) have values that can never change
2) are created using the define() function
3) do not use an initial dollar sign
4) All of the above
4. In order to execute a PHP script, you must have: 2
1) A Web browser
2) A PHP-enabled Web server
3) A text editor
4) A PHP enabled client's Web browser
5. Assuming the variable $var has been assigned a value 4
of 0, which of the following will be true?
1) empty($var)
2) isset($var)
3) $var == 0
4) All of the above
, CS 6314 Test 3 Review
Study online at https://quizlet.com/_cea78p
6. When you use the require() function to include an ex- 2
ternal file, the code in that external file will automati-
cally be treated as PHP.
1) True
2) False
7. Arrays can be created using the _____ function. 3
1) make_array()
2) create_array()
3) array()
4) is_array()
8. In order for the contents of an included file to be 2
treated as HTML, it must use the .html file extension.
1) True
2) False
9. If the require() function cannot include the file, it will 3
_____.
1) do nothing
2) generate an error
3) generate an error and terminate the script
4) generate a warning
10. How do you set a text input's value? 1
1) Assign a value to the input's value attribute
2) Assign a value to the input's checked attribute
3) Assign a value between the opening and closing
tags
4) Assign a value to the input's selected attribute
11. As we discussed in the class, consider a MySQL data- 1
base connection with mysqli (using $connection) run
, CS 6314 Test 3 Review
Study online at https://quizlet.com/_cea78p
successful. The following call will set its auto-com-
mit default to be off. mysqli_autocommit($connection,
FALSE);
1) True
2) False
12. As we discussed in the class, consider a MySQL data- 2
base connection with mysqli (using $connection) is
successful and its sql query ($sql) run successfully.
Which one of the following choices is a correct call
to loop through the result ($result) with mysqli (not
prepared statement) using while statement?
1) while($row = mysqli_fetch_one($result))
2) while($row = mysqli_fetch_assoc($result))
3) while($row = mysqli_fetch($connection, $result))
4) while($row = mysqli_fetch_array($result))
5) while($row = mysqli_fetch_result($result))
13. As we discussed in the class, consider a MySQL data- 5
base connection with PDO ($pdo) is successful and got
its SQL query result ($result). Which one of the follow-
ing choices is a correct call to free the result ($result)
and close the connection ($pdo) with mysqli?
1) PDO_free($result); PDO_close($pdo);
2) PDO_close($result); PDO_close($pdo);
3) PDO->free_result($result); PDO->close($pdo);
4) PDO_free($result); PDO_disconnect($pdo);
5) $result=null; $pdo = null;
14. As we discussed in the class, consider a MySQL data- 4
base ($dbname) in a host ($dbhost) with a DB user
($dbuser) with its password ($dbpass), using PDO.