Skip to main content

Posts

Showing posts with the label Binary String Type

Database Authentication

The final, and most complete of the three PHP authentication methods, is the utilization of a database to maintain and manage the usernames and passwords used to access PHP files. This solution provides advanced capabilities in administering authentication systems but also provides incredible flexibility and scalability to incorporate the authentication system into the database system as a whole. The first step of the process involves creating the user tables that will be used to house the authentication data. Storing Authentication Data The following table will be used to manage the storage of the login information that will be used by PHP to manage logins: CREATE TABLE `customers` ( `customerEmail` VARCHAR(40) NOT NULL, `lname` VARCHAR(25) NOT NULL, `fname` VARCHAR(25) NOT NULL, `title` ENUM('Mr.', 'Mrs.', 'Miss', 'Ms.','Dr.'), `passwd` VARCHAR(30), PRIMARY KEY (`customerEmail`) ); The idea of using the customerEmail as the lo

Storing the Session Data

Once the session has been initialized, the data that must remain persistently can be stored in the superglobal $_SESSION array. The following are examples of storing persistence data to this superglobal array: <?php $_SESSION['fname'] = 'George'; $_SESSION['lname'] = 'Burnes'; ?>

String Data Types

A string data type is a data type modeled on the idea of a formal string. They are commonly used to store  text or binary data. Types are available to hold values of varying maximum lengths and can be chosen  according to if the values are to be treated as text, binary or integer. Strings are such an important and  useful data type that they are implemented in nearly every programming language. Text String Type Summary For the storage requirement values, M represents the maximum length of a column. L represents the actual  length of a given value, which may be 0 to M. CHAR( )                       A fixed section from 0 to 255 characters long. VARCHAR( )               A variable section from 0 to 255 characters long. TINYTEXT                   A string with a maximum length of 255 characters. TEXT                            A string with a maximum length of 65535 characters. MEDIUMTEXT            A string with a maximum length of 16777215 characters. LONGTEXT