Home  >  Article  >  Backend Development  >  How to create fake information in php mysql

How to create fake information in php mysql

WBOY
WBOYOriginal
2016-10-11 14:23:151068browse

This is it. I need some data for testing
So I need to create fake data.
I would like to ask how to use PHP to write a fake data to the database?
My database has a main key called buy_id (it will be AUTO_INCREMENT)
It would be best if I could set how many pieces of fake information to create?

Reply content:

This is it. I need some data for testing
So I need to create fake data.
I would like to ask how to use PHP to write a fake data to the database?
My database has a main key called buy_id (it will be AUTO_INCREMENT)
It would be best if I could set how many pieces of fake information to create?

After PHP connects to the database, it loops to construct the data based on each field that needs to be inserted, and then inserts it into the database

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn