Wednesday, September 16, 2009

layman data III

Helpful links: **Google MySQL Primer CERT Bulletins Webmaster World Forum Simulate foreign keys - MyISAM Cascading and key constraints - MyISAM, InnoDB, NDB Create tables using PHP script
This is the third in the series, though not meant as a coherent progression. A random collection of tidbits or crumbs to follow. Recently: * Cascading and foreign key constraints with different engines. My webhoster provides only the MyISAM engine, so no foreign keys. Foreign keys are the "relation" in an RDBMS, auto-updating child relations when a parent is updated, cascading inserts and deletes, and so on. This apparently can be approximated in a number of ways in MyISAM. TRIGGERs can be created, loops which do multiple inserts, etc. The InnoDB engine makes this process native from the time of creating the tables. Much easier. To switch between engines in existing tables, we use: ALTER TABLE tablename TYPE = MyISAM; * Added CERT link above. The CERT bulletin link above quickly reveals the many injection threats arising each week. It appears one has to lock-down the code of a production server which, in turn, apparently requires time and patience to learn and implement. * Scripts to install tables. Appear to format as .sql dump files but without the data inside. * Proper documentation, once this is more focused and defined. So far, a simple RTF file using underline for primary, and italic for foreign key, has been helpfully direct. Seen it elsewhere too, but read it in Welling, L., Thomson, L. (2008). PHP and MySQL® Web Development, Fourth Edition. Addison-Wesley Professional. pg 208-209 informit link ~$50. REFERENTIAL INTEGRITY

No comments: