Prev | Current Page 196 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"


CHAPTER 5 ?–  CREATING THE PRODUCT CATALOG: PART 2 118
The good news is that you can have different types of tables inside a single database, so
you can use MyISAM for tables that don??™t need free-text searching and/or foreign keys and
InnoDB for the others. You must be extra careful when manipulating data from MyISAM
tables, however, because you can??™t rely on the database to enforce its integrity on its own.
?– Note Foreign keys can be programmatically implemented for the storing engines types that don??™t support
them, with the aid of triggers. You can find a good tutorial about this technique at http://dev.mysql.com/
tech-resources/articles/mysql-enforcing-foreign-keys.html.
Before implementing the rest of the product catalog tables, we need to explain more
about the various types of MySQL table types.
MySQL Table Types
MySQL supports several storage engines that can be used to store your data. When creating a
new data table, if not specified otherwise, the default table type (MyISAM) is used. Following
are three important table types supported by MySQL:
MyISAM is the default storage engine when creating new tables since MySQL 3.23 (when
it replaced its older version, ISAM). It is the fastest table type in MySQL, at the cost of not
supporting foreign keys, CHECK constraints, transactions, and some other advanced features.
However, unlike the other table types, it supports full-text searching, which is very
helpful when implementing the searching capability in the web site.


Pages:
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208