Specifications

BDB. These tables are transaction safe; that is, they provide COMMIT and ROLLBACK capabil-
ities. They are slower to use than the MyISAM tables, and are based on the Berkeley DB.
At the time of writing, these were still being debugged in MySQL version 3.23.21, and
will require an extra download in order to be used, available from the MySQL Web site.
These additional table types can be useful when you are striving for extra speed or transac-
tional safety.
Loading Data from a File
One useful feature of MySQL that we have not yet discussed is the LOAD DATA INFILE state-
ment. This can be used to load table data in from a file. It executes very quickly.
This is a flexible command with many options, but typical usage is something like the follow-
ing:
LOAD DATA INFILE “newbooks.txt” INTO TABLE books;
This will read row data from the file newbooks.txt into the table books. By default, data fields
in the file must be separated by tabs and enclosed in single quotes, and each row must be sepa-
rated by a newline (\n). Special characters must be escaped out with a slash (\). All these char-
acteristics are configurable with the various options of the LOAD statementsee the MySQL
manual for more details.
To use the LOAD DATA INFILE statement, a user must have the FILE privilege discussed earlier.
Further Reading
In these chapters on MySQL, we have focused on the uses and parts of the system most rele-
vant to Web development, and to linking MySQL with PHP.
If you want to know more, particularly with regard to non-Web applications, or MySQL
administration, you can visit the MySQL Web site at
http://www.mysql.com
You might also want to consult Paul Dubois book MySQL, available from New Riders
Publishing.
Next
We have now covered the fundamentals of PHP and MySQL. In Chapter 12, Running an
E-commerce Site, we will look at the e-commerce and security aspects of setting up database-
backed Web sites.
Advanced MySQL
C
HAPTER 11
11
ADVANCED
MY
SQL
263
14 7842 CH11 3/6/01 3:35 PM Page 263