title: Mysql Dynamic Table expanding columns
body: <p>I am wondering if there is a better way to make some mysql tables than what I have been using in this project. I have a series of numbers which represent a specific time. Such as the number 101 would represent Jan 12, 2012 for example. It doesn't only represent time but that is the very basic of that information. So I created a lexicon table which has all the numbers we use and details such as time and meaning of that number. I have another table that is per customer which whenever they make a purchase I check off that the purchase is eligiable for a specific time. But the table where I check off each purchase and the lexicon table are not linked. I am wondering if there is a better way, maybe a way to have an sql statement take all the data from the Lexicon table and turn that into columns while the rows consist of customer ID and a true/false selector. </p>
  
  <pre><code> table structure
  
   THIS IS THE CUSTOMER PURCHASED TABLE T/F
   CREATE TABLE `group1` (
  `100` TINYINT(4) NULL DEFAULT '0',
  `101` TINYINT(4) NULL DEFAULT '0',
  `102` TINYINT(4) NULL DEFAULT '0',
  ... this goes on for 35 times each table
  PRIMARY KEY (`CustID`)
   )
  
  
   THIS IS THE LEXICON TABLE
   CREATE TABLE `lexicon` (
  `Number` INT(3) NOT NULL DEFAULT '0',
  `Date` DATETIME NULL DEFAULT NULL,
  `OtherPurtinantInfo` .... etc
  
   )
  </code></pre>
  
  <p>So I guess instead of making groups of numbers every season for the customers I would prefer being able to use the updated lexicon table to automatically generate a table. My only concerns are that we have many many numbers so that would make a very large table all combined together but perhaps that could be limited into groups automatically as well so that it is not an overwhelming table. </p>
  
  <p>I am not sure if I am being clear enough so feel free to comment on things that need to be clarified. </p>