ITP-225 CH3 (PHP), ITP-225 CH8 (PHP), ITP-225 CH1 (PHP), ITP-225 CH2 (PHP), ITP-225 CH5 (MySQL), ITP-225 CH4 (MySQL), ITP-225 CH6 (MySQL), ITP-225 CH9 (PHP & MySQL)
(All of the above) letters, underscores, and numbers
"A database, table, or column name can consist of _____."
the server
"By default, MySQL stores dates and times using the time zone of _____."
ascending
"By default, ORDER BY sorts results in _____ order."
highest
"During development, scripts should be set on the _____ level of error reporting."
UNSIGNED
"If a numeric type will never store negative values, that column should be marked as _____."
mysqli_affected_rows()
"The _____ function returns the number of records affected by an INSERT, UPDATE, or DELETE query."
error_reporting()
"To change the level of error reporting in an individual PHP script, use the _____ function."
set_error_handler()
"To have a PHP script use your own custom error handler, provide the name of that error handling function to PHP?s _____ function."
DEFAULT
"To indicate a default value for a column, add the _____ property to its definition."
identical to a primary key in a related table
A foreign key is _____.
any number of
A function can have ____ return statements.
DECIMAL
A price of a product in an e-commerce site should be stored in a column of type _____.
False
A single equals sign = is used to see if two values are equal.
DELETE
A single record can be removed from a table using _____ and a LIMIT clause or conditional.
CHAR(2)
A two letter state abbreviation would be best stored in a column of type _____.
(All of the above) letters, numbers, and underscores
A user-defined function's name can contain _____.
a number
A user-defined function's name cannot start with _____.
local or function
A variable defined within a function, including a function's arguments, is said to have ____ scope.
False
A variable in PHP is case-insensitive:
(All of the above) letters, numbers, and underscores
A variable's name can consist of:
array()
Arrays can be created using the ____ function.
rows
Conditionals in a query impact which _____ are returned.
(All of the above) are created using the define() function, have values that can never change, and do not use an initial dollar sign
Constants differ from variables in that they _____.
True
Enabling display_errors in the PHP configuration file will result in all PHP errors always being shown.
after those without default values
Function arguments with default values should be placed _____.
USE
The _____ SQL command is used to select the database with which you want to work.
UPDATE
The _____ command is used to change the values already stored in a table.
mysqli_num_rows()
The _____ function returns the number of records returned by a SELECT query.
errors
The _____ level of PHP errors is indicative of a problem and does stop the execution of the script.
warnings
The _____ level of PHP errors is normally indicative of a problem but does not stop the execution of the script.
notices
The _____ level of PHP errors may or may not be indicative of a problem but does not stop the execution of the script.
every column
The asterisk in the query SELECT * FROM tablename means _____.
(All of the above) the entire database, each separate table, an individual column
The character set can be assigned to _____.
False
The character set used by the database can be different than that used by the PHP script or HTML page.
command line interface
The mysql client is accessible through your computer's _____.
True
The mysqli_real_escape_string() function requires a database connection.
InnoDB and MyISAM
The two most commonly used storage engines in MySQL are _____.
(All of the above) a semicolon, and \g
SQL commands within the mysql client are terminated with _____.
return
To have a function return a value, use the ____ keyword.
use print_var()
To reference an element in an associative array within a string, you must ____ or else you'll create a parse error.
$_SERVER['REQUEST_METHOD']
To test if a form that uses the POST method has been submitted, you can check if ____ equals POST.
one-to-none
Which of the following is not a relationship type?
<!-- and -->
Which of the following is not a valid PHP comment indicator:
(All of the above) Strings, Dates, and Times
Which of the following value types should be quoted when used in queries?
(All of the above) $_GET, $_POST, and $_COOKIE
Which superglobal variable is a subset of $_REQUEST?
True
You can place multiple pairs of PHP tags within the same file.
True
You can use different storage engines within the same database.
allow for NULL values
You should not index columns that _____.
many-to-many
Your database design should avoid two tables with a _____ relationship.
Run-time
_____ errors only appear during the execution of a script.
Logical
_____ errors will not be reported by PHP.
Syntactical
_____ errors will prevent a PHP script from running.
A PHP-enabled Web server
In order to execute a PHP script, you must have:
foreach
When you can know in advance how many times a loop will be iterated, you normally use a ____ loop.
.php
PHP scripts normally use the file extension.
(All of the above) must always have a value, must always have a unique value, and must have a value that never changes
Primary key columns _____.
(All of the Above) NOT NULL, AUTO_INCREMENT, and UNSIGNED
Primary key columns should almost always have the following properties:
0
Indexed arrays begin with a key value of ____, unless otherwise specified:
Assign a value to the input's value attribute
How do you set a text input's value?
generate a warning
If the include() function cannot include the file, it will _____.
generate an error and terminate the script
If the require() function cannot include the file, it will _____.
the PHP code will not be executed
If you do not execute a PHP script through a URL that begins with http, _____ .
(All of the above) KEY, UNIQUE, and FULLTEXT
MySQL supports the _____ index type.
action
Use a ____ form's attribute to indicate to what PHP script the form data should be submitted.
mysqli_connect()
Use the _____ function to establish a connection to a MySQL database.
while
What PHP language construct should you almost always use to fetch query results?
INSERT
What SQL command is used to add a record to a table?
SELECT
What SQL command is used to fetch records from a table?
CREATE
What SQL command is used to make a new database or database table?
USE
What SQL command is used to select the database with which you want to work?
<?php and ?>
What are the PHP tags?
foreach
What control structure is normally used to access every element in an array?
is_numeric()
What function can confirm that a value is numeric?
mysqli_query()
What function is used to execute a SELECT query?
mysqli_query()
What function is used to execute an INSERT query?
mysqli_fetch_array()
What function is used to get a single MySQL record?
mysqli_connect_error()
What function is used to get the error MySQL reported if a database connection could not be made?
mysqli_error()
What function is used to get the error MySQL reported if a query failed?
asort()
What function would you use to sort an array by value, while maintaining the array's keys?
. (a period)
What is the concatenation operator?