> 
> **Duplicate:**  
> 
> [Inserting random characters to MYSQL Database](https://stackoverflow.com/questions/2498310/inserting-random-characters-to-mysql-database) 
> 
> 
> 

How can I generate 100 records with 5 random characters and insert into the database with a query. 

I want to insert into this table:

```
codes
  id (auto-increment)
  codes

```