Terms


database - a grouping of related information into a single container.  Needs a unique name on the server. Can be up to 64 characters. Cannot start with a space. No forward or backward slashes, exclamation points or asterisks. Spaces are allowed within the name but not recommended.

table - a subset of data within a database, which contains a grouping of similar data items.

data fields - hold individual data elements within a table. This is where the application actually stores the data.

data records - the table groups data fields into data records. Each data record is the information about one occurrence of given set of data fields.

 data type - each data field must be identified as to the type of data that will be stored there.

data constraints - controls how you place data in a data field.

data constraint - primary key -Most popular data constraint is a primary key. MySQL creates a hidden table to relate the primary key values to the records numbers and then retrieves the query data based on the primary key information.

data constrain - IS NULL - If this is present then a value has to be entered into a data field. Primary key cannot have an empty field (this is automatic for all records).

 

 

Comments (0)

If (conditional)

 {   php statements if condition true

 php statement 1

    php statement 2

   php statement 3

 }

else

 { php statement if condition was false

php statement 1

   php statement 2

   etc

 }

 

If you want more then one else statement the first else state becomes an elseif

 

 

Comments (0)

== equal to

!= not equal to

< less then

> greater then

<= less then or equal to

>= greater then or equal to

 

Comments (0)

A php variable is identied by a leading dollar sign $ in front of the variable.  The variable name can start with either a letter or an underscore _  The name can only contain letters, numbers or underscores.  No spaces.

Assignment statements are used to give variables values i.e.    $name="Linda";

all statements end with a semi-colon ;

String values must be enclosed in quotes.

Variable types do not need to be declared.  The can go from string to numeric to string.

Variables can be inserted into an echo statement i.e.,

echo "my name is $name\n";

To start a new line one need to put a line break in the code before \n  The statement would read:

echo "my name is $name <br/> \n;

Array Variables

Array variables are assigned in an assignment statement with (...) around the values and the word array in front of the (. There is also a comma between each element.  i.e.

$name=array("linda" ,"Peter", "Sean")

Array variables are reference by numbers between brackets [ ] The numbering system starts with 0 This is called a numerical array because it uses numbers to reference the array.

Associative Array uses a string key value to identify the data values.  An example of an associative array of names would be:

$associativename = array("Girl"=> "Linda", "Boy"=>"John");

echo "The Girl is {$associativename["Girl"]} <br />\n";

echo "The Boy is {$associativename ["Boy"]}  <br />\n";

Be sure to put the ending bracket after the ].  So it would be {$...[ ]}

Also do not forget the closing quotes.

Arithmetic codes


+ addition

- subtraction

* multiplication

/ division

%  modulus

 

 

 

Comments (0)