Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3799556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:45:08+00:00 2026-05-19T13:45:08+00:00

I have a MySQL table which I want to populate with some dummy data

  • 0

I have a MySQL table which I want to populate with some dummy data for testing (50+).

This table has a foreign key to another table so the dummy data must cross reference from that table but again be random i.e. can’t all be the same foreign key.

It also has a date added field which I want to populate with a random date within a year span e.g. any date in the year 2010.

my table structure is:

id, customer_id, date_added, title, total_cost

where id is the primary key, customer_id is the foreign key and date_added is the date field.

What is the best way of doing this? I’d prefer to do it directly in MySQL but if not my site is running on Python so a way of doing this in that would do.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:45:09+00:00Added an answer on May 19, 2026 at 1:45 pm

    If you really want to get down with some setting up of testing data, you should go the fixture route. This will help set yourself up a pretty nice development environment and may integrate very nicely into your website’s framework if you’re using one.

    You can find a link to the documentation of the fixture module here

    If you think that’s a little too much work to get all working, look into the MySQLdb module which will help you insert data into your table.

    It may be in poor taste to link back to a stackoverflow, but someone has already answered the date question you are asking. You can find that here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with 27 varchar fields. I want to make all fields
I have a production server whose MYSQL may not be backed up. The instance
I have a PHP script that creates an entry into a mysql database. The
I am trying to write a query to create a 'table' of data as
I need a method of stopping concurrent logins using PHP/MySQL. The current setup Currently
I want to understand how to use templating system and permalinks on php websites
I am importing approx 350,000 lines from a CSV file into MySQL using PHP
I am wondering if my theory is right here so looking for some advice
Simply said: How do I receive data from a PHP echo to display using
I came across a question today of search efficiency for large sets today and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.