Jump to content

Dynamically generate mySql Create Index statements


redbrad0

Recommended Posts

I know in mySql you can run "show indexes from TableName" and it will show you a list of all the index's for that table. What I would like to do is run this query to generate a create index statement that I can run on another database all thru PHP. Has anyone allready built something like this in PHP to post some code?

 

mysql> SHOW INDEXES FROM reviews;

+---------+---------------+--------+------+------------+---------+

| Table  | Column_name  | Packed | Null | Index_type | Comment |

----------+---------------+--------+------+------------+---------+

| reviews |  id          | NULL  |      | BTREE      |        |

| reviews |  data        | NULL  | YES  | FULLTEXT  |        |

+---------+---------------+--------+------+------------+---------+

2 rows in set (0.01 sec)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.