FakerExample.php 358 B

123456789101112131415
  1. <?php
  2. require '/usr/local/code/common/commoncore.inc.php';
  3. require 'vendor/autoload.php';
  4. // More here https://github.com/fzaninotto/Faker
  5. use Faker\Factory as Faker;
  6. $db = DBi::getInstance('db-stats', 'test');
  7. $faker = Faker::create();
  8. for($i = 0; $i < 5; $i++)
  9. {
  10. $sql = "INSERT INTO faker SET faker_name = '" . $faker->name . "'";
  11. $db->query($sql);
  12. }