IT202 Exam 2
To get the value of a cookie you can use the superglobal variable
$_COOKIE
Once a session has started, you can use the superglobal variable _______ to set the user's data for the session.
$_SESSION
If a request is not sent a session will end after
24 minutes
If a PHP array contains 7 elements, what is the number of the index of the seventh element?
6
_______ provide a way for a web application to store information in the user's web browser and retrieve it everytime the user requests a page
Cookies
Which of the following is NOT a common MySQL datatype?
DBL
Which clause in a SQL statement specifies the tables that should supply the data that is returned?
FROM
Which of the following is a SQL statement that you can use to add a row to a database?
INSERT
Which clause in a SQL statement specifies how the result set should be sorted
ORDER BY
In the catch block of a try/catch statement for handling PDO exceptions, you can get a message that describes the exception by using the getMessage() method of the
PDOexception object
Which clause in a SQL statement specifies the columns to return
SELECT
When you use session tracking, each HTTP request includes
a cookie containing the session id.
The $_SESSION variable for a session is
an associative array
The process of determining if a server or client is who or what it claims to be is known as
authentication
To execute a prepared SQL statement, you can us the _______ and execute() methods of the PDOStatement object to set parameter values and execute the statement
bindValue()
The intersection of a column and a row in a database table can be called a
cell
Encryption and Decryption algorithms are also known as
ciphers
When coding relative URLs, you can begin the URL with a single dot (.) to indicate that the URL should start with the _________ directory.
current
An _______ is an object that contains information about an error
exception
Which of the following is an object that contains information about an error that occured?
exception
A hash function takes a variable size string and returns a fix-sized string known as a
hash
Which URL can be used to start phpMyAdmin on a local system
http://localhost/phpMyAdmin
To refer to the elements in an array, you use a string or numeric
index
What are the parameters of the setcookie function?
name, value, expire
What keywords must you code to create a PDO object?
new
If a row in one table is related to just one row in another table, the tables are said to have a
one-to-one relationship
Which PHP function can be used to end a session?
session_destroy()
To delete a cookie you
set the cookie's value to an empty string and its expiration to a date in the past
What php function is used to create a cookie
setcookie()
What attribute of a column determines the data that can be stored in the column?
the data type
When you use form-based authentication
the programmer writes the code for the authentication process themself
To handle exceptions, first you code a ________ around any statements that might throw an exception
try block
To handle the PDO exceptions that can occur when database methods are executed, you use a _______ statement.
try/catch
The column definition for a MySQL table can be used to determine all but one of the following. Which one is it?
what range of values the column can contain