PHP and MySQL general
URL
Uniform Resource Locator
mysqli_error()
gives the error (if any) for the mysqli_query(). takes (database connection)
mysqli_connect_error()
gives the error if there is a connection error. takes no arguments
The 4 parameters, in the proper order, needed to connect to a PHP database
host, userName, password, databaseName
Button you push in mySQL to bring in external data
import
Type this word in the address bar of any browser to get to phpMyAdmin
localhost
test condition
located in ( ) after if -- the statement that you want to determine the validity of
PHP is a ______ typed language
loosely
mysqli_query()
make a query to the MYSQL database. takes (connection information, query)
show highest number in an array
max
show lowest number in an array
min
create database
mysql command to create a new database
insert into
mysql command to store data in a table
select
mysql command which allows you to request columns of data from a table
!
negation operator (the NOT operator), reverses a true/false value.
PHP is _____ source software
open
A _______ is a local variable whose value is passed to the function by the calling code
parameter
Extension for PHP files
php
echo
php command for sending output to the browser window
empty()
php function determines whether a variable contains an empty value
mail()
php function for sending an email
isset()
php function that tests to see if a variable exists (that it has been assigned a value)
mysqli_connect()
php function used to connect to mysql database
mysqli_query()
php function used to store or receive data from a mysql database table
die()
php function used to terminate a php script and provide feedback about code that failed
foreach
php looping construct that allows you to loop through an array one element at a time without using a test condition
.
php strings are joined/concatenated by this character
An 'id' should be designated as a ______ ____ with ___________ enabled
primary key ... auto increment
show all items in $array1
print_r($array1);
put an array in order of maximum value to minimum value
rsort
The _____ of a variable is the portion of the script in which the variable can be referenced
scope
PHP is a _________ language
server-side
put an array in order of minimum value to maximum value
sort
add column
sql command to append a new column to a table
modify column
sql command to change data type or position of a column within a table
change column
sql command to change the name and data type of a column mysqli_connect() PHP command to connect to a database
drop column
sql command to delete a column from a table
Built-in function for finding the length of a string
strlen
True or false: PHP is considered a scripting language
true
True or false: PHP strings may be delimited by either double or single quotes
true
True or false: PHP variables are case-sensitive
true
Extension for an 2010 Excel file
xlsx
PHP command name to tie in to a database
mysqli_connect
$_POST
php array that holds form data
Typical mySQL datatype for an 'id'
INT
PHP
"PHP: Hypertext Preprocessor"
Write a correct PHP statement that creates a variable called 'myFlavor' with the value of 'vanilla'
$myFlavor = "vanilla";
PHP concatenation operator
.
Block comment synax
/* blah blah blah */
Single line comment syntax
//blah blah blah
Given: echo strpos("ABCD", "A"); What is the resulting output?
0
The default delimiter in mySQL that must be changed to bring in Excel CSV information
;
Shorthand delimiter for PHP code segments
<? ?>
Delimiter for PHP code segments
<?php ?>
turn array1 into a string separated by commas and show it
<?php echo $string1 = implode(" , ", $array1); ?>
This is a character you can place before a PHP/mySQL command that will suppress warnings on a user's screen if there are connection problems to a database. It should NOT be used in development (you want to see your warnings!) but it should be used for live sites (so as not to scare your users).
@
What is mySQL?
A database server
&&
AND logical operator; results in true if both values are true
true or false is called a
Boolean alter table sql statement changes structure of a table (or database,) such as adding a new column of data
CSV
Comma-Separated Values
To take an Excel file to a mySQL database, you must first convert it to a _____ file
CSV
loosely-typed
Explicit data types are not required
______ scope refers to any variable that is defined outside of any function
Global
or die()
If a connection does work, use this to kill the attempt and display and error message mysqli_connect() connect to the MySQL database. takes (database host, database user, database password, database name)
A variable declared within a PHP function becomes ____ and can only be accessed within that function.
Local
Make sure you do this to your Excel information before you convert to CSV file
Make sure there are no commas in the entire sheet; if they are there, use global find/replace to make them something else you can change back to commas later using PHP
INSERT
MySQL command to input data into a database
or
OR logical operator; results in true if either of the values are true
mysqli_close()
PHP function used to close a connection with a mysql database
To create a user in PHPmyAdmin, to to this place
PHPmyAdmin Home Page>Privileges
When a table's structure is being viewed, this shows that a field is a primary key
The name of the field is underscored
Valuable platform integrating PHP and mySQL
XAMPP
comparison operators
_______ can be used to construct test conditions that compare values to each other; often used to control if statements and loops
superglobal
a name used to describe build-in php variables that are accessible to all scripts (e.g. $_POST)
Every function must have
a parameter list delimited by parentheses, even if that list is empty
Another name for parameter
argument
myFlavor is an example of
camel case
Variables are _____ for storing information
containers
function to show number of items in an array
count
array
data structure that stores a set of values/variables
Command to print information on a web page
echo
urlencode()
encodes text for urls. ex. spaces = %20
\n
escape character that creates a new line -- MUST be enclosed by double-quotes
True or false: Spaces are acceptable in PHP variables
false
Columns in Excel are analogous to _____ in mySQL
fields
mysqli_fetch_array()
gets the array of the results from the MySQL query. takes (results variable)