Filling a table with info for testing

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
quince
Forum Newbie
Posts: 15
Joined: Tue Jul 05, 2005 10:17 am

Filling a table with info for testing

Post by quince »

I want to fill one of my database tables with a bunch of info(junk/anything) to test the search speeds when there are several thousand entries. is there some sort of dynamic insert loop I can use?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Code: Select all

for ($x = 0; $x < 10000; $x++;) {
   mysql_query('INSERT INTO `table` SET `column1` = \'jdsfhsdhfjashfkshdffsdf\'') or die(mysql_error());
}
I would create a function that generates random strings in replace to inserting the same junk over and over though.
quince
Forum Newbie
Posts: 15
Joined: Tue Jul 05, 2005 10:17 am

Post by quince »

thanks! thats just what I'm looking for, I will make it a bit more dynamic and post it. 8)
Post Reply