Retrieve multiple rows from mysql and automatically create a table

Hi, i want to create a table automatically based on another table (sms_key).
For example;

If user create a new row with sms_keyword field: IRC then a table created automatically (with some field on it, like: name, ph_number, messages).

select * from sms_key;
+-------------+
| sms_keyword |
+-------------+
| IRC         |
| PTM         |
| ADM         |
| BS          |
+-------------+
select * from IRC;
+------+-----------------------------+
| x    | Name | ph_number | messages |
+------+-----------------------------+
|    1 |         |                |               |
+----+-------+-----------+----------+

can I do that in mysql?
thank you

There are two obvious ways, either put the table HTML in the SQL string generation, or postprocess the SQL output with sed or the like. I usually do the latter:

echo '<TABLE>'
 
echo "SELECT 'dAtA' x, t.* from some_table t order by 1,2,3,4 ;" | mysql ... | sed '
  s/^| dAtA | /<TR><TD>/
  t good
  w logfile
  d
  :good
  s/  *|$//
  s/  *|  */<TD>/g
 '
 
echo '</TABLE>'