We have quickly scooted through the installation and configuration of web servers, the MySQL database server, and PHP5 language engine in this appendix. Although this will help us get up and running quickly with our book and let us play with scripts quickly, it is rarely a good idea to take web applications live without spending much more time learning about the various configuration options and spending the time fiddling with them.
There are a number of security documents written for each of the servers, and those, combined with the advice in this book and an evening or two of playing, should be enough to provide all the information you need to fully prepare the software for your exact needs.
Appendix B. Database Function Equivalents
Although most of the examples in this book use a SQL syntax that is specific to MySQL versions 4.1 and greater, you are not
This appendix shows the equivalent SQL syntax for various table types, operations, and other important aspects of web applications covered in this book. These suggested
Working with Databases
Let's look at some basic operations you might want to do when interacting directly with your database server.
Listing Available Databases
To list those databases available to you when you first connect to a database server, use the following:
Listing Tables in a Database
To list tables available in the currently selected database ( USE DatabaseName ), use this:
Describing a Table
To see the structure of a table, use this:
Data Description and Creation
Now that we know which databases and tables we are using, we can look at differences in how we specify various features during the creation process.
Creating Databases to Work with UTF-8
To create databases that understand UTF-8 input and store string values as Unicode text in tables, we use the following queries. We also use these to specify the default sorting order (collation) for these new databases:
Setting the Connection to UTF-8
Even if the database server is set up to use UTF-8 correctly, we need to ensure that the connection is set up correctly:
Fields that have an auto-incrementing index after every row insertion are quite different from server to server:
Date/Time Column Types
To create a column of a date or time type, you must change your SQL from server to server:
Binary Column Types
To store binary data in your database, you need to use a special data type:
Large Text Column Types
Bulk Data Insertion
Inserting data into your database outside of PHP code can sometimes be done by using what is known as bulk data insertion . It is very specific to servers: