Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts

    Looking for test data to populate database

    Hi...

    Guess I am feeling a bit lazy; however, I was curious of anyone knew of some resources where dummy/test data could be acquired.

    In developing an application, it is tiresome to have to key in 30-50 records of data in order to more fully test the application. Ideally, am looking for either public databases to dump or csv files - fields would be comprised of - lastname, firstname, street, city, zip, telephone, company names - deadend emails and urls that exist but don't exist (by that I mean have the ability to be checked as valid emails and urls but are not being used - don't want to send test emails to the same few addresses or real urls)

    Thanks,

    Lite...

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't know of one, but couldn't you make one yourself? I'm sure you can write a PHP script that would create random text and insert it into your database..

    I think it would be difficult to come up with a generic csv that would match your (or anyone else's) table/schema.

    Sadiq.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I second sad69s suggestion. Write a small PHP script do create test data that exactly fits your needs. Define some arrays with first/last names, city and street names, and let emails point to example.com, this URL is reserved as a testing placeholder. During a loop, construct your SQL statement by using random values out of these test data arrays. Repeat until you're satisfied with the amount of data created.

    This has the added value that you'll have to think what kind of data might wander into your database (for example, where do you put the middle initial of names? First name or last name? What with titles?).

    BTW, I do have sample SQL code for cities, countries etc. But I don't know if it's useful to you, because it follows german formats and I doubt that the zip code you have in mind matches the one used in Germany. Another argument for "rolling your own".
    De gustibus non est disputandum.

  • #4
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    Thanks. I appreciate the input and have begun to do just that.

    Using about 2000 name I 'borrowed" off of a Popular baby names site and a few hundred surnames garnered from some geneology (sp) sites. I figure using a small random number script will provide me with more than ample names. Then couple that with some carefully garnered cities/state/zips/area codes, I should be able to create a few thousand unique entries.

    I appreciate your responses.

    Lite

  • #5
    New Coder
    Join Date
    Nov 2002
    Posts
    87
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would use excel or open office to make the csv file. You can put values in one cell and drag them down as needed. Should take about 10 seconds to make 1000+ records.

  • #6
    New Coder
    Join Date
    Jul 2007
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I realized I am very late, but this is exactly what you need

    http://github.com/caius/php-faker/tree/master
    -

  • #7
    GŁtkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    You are very late indeed. That thing you linked to didn't even exist five years ago.

  • #8
    New Coder
    Join Date
    Jul 2007
    Posts
    26
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by venegal View Post
    You are very late indeed. That thing you linked to didn't even exist five years ago.
    I found this thread while I was searching on Google for something similar, this post didn't help me so I kept on searching and I found the link above. I posted it here to help future people who are looking for something similar or gets on this thread the same way I did.

    It was not solely aim at the thread starter because obviously he must've found his solution by now.
    -


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •