MySQL stored procedure's come in really handy at times. I like to let the database do the work for me sometimes. For example, in an e-commerce system you may need to calculate a tax. For our example today though, we will use the tables we made in my previous article on the XREF table. We are going to focus this tutorial on getting the appropriate tables in place to preform our history logging. To start, we are going to create a module's table so that our history table can be one table instead of many and we are...
The XREF, or cross reference table, is a database table that links records together. These tables are very good for normalization in your database. I almost always use an xref when I need an many to many relationship. Usually XREF tables have only two columns with no Primary Key. That's right, the two columns together make them unique. They are both Foreign Keys to other tables. A real life example of this would be in any standard CRM. Let's go over this example right now. Many CRM's could have a table to store...