<?php error_reporting(1); $host = 'localhost'; $user = '******'; $pass = '******'; $db = 'akondapalli'; $load = new LoadTestData($host, $user, $pass, $db); $load->addUsers(); //$load->loadCourses(); class LoadTestData { var $db; //var $Roles; function __construct($host, $user, $pass, $db) { //connect to database on local server $this->db = new mysqli($host, $user, $pass, $db); if ($this->db->connect_errno) { echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error; } } function addUsers() { //pull entire user from object to make code below easier to read $last = $_POST['last']; $first = $_POST['first']; $street = $_POST['street']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip'];
<?php error_reporting(1); $host = 'localhost'; $user = '******'; $pass = '******'; $db = 'rkulkarni'; $load = new LoadTestData($host, $user, $pass, $db); $load->updatedate(); //$load->loadCourses(); $load->InsertReservation(); class LoadTestData { var $db; var $users; var $Roles; var $Aircrafts; function __construct($host, $user, $pass, $db) { //connect to database on local server $this->db = new mysqli($host, $user, $pass, $db); if ($this->db->connect_errno) { echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error; } $this->Roles = array(); $this->loadFlights(); $this->Aircrafts = array(); $this->loadAircraft(); $this->users = array(); $this->loadusers(); }
<?php error_reporting(1); $host = 'localhost'; $user = '******'; $pass = '******'; $db = 'rmannava'; $load = new LoadTestData($host, $user, $pass, $db); $load->addUsers(100); class LoadTestData { var $db; var $Roles; var $Credits; function __construct($host, $user, $pass, $db) { //connect to database on local server $this->db = new mysqli($host, $user, $pass, $db); if ($this->db->connect_errno) { echo "Failed to connect to MySQL: (" . $db->connect_errno . ") " . $db->connect_error; } $this->Roles = array(); $this->Credits = array(); $this->loadRoles(); $this->loadCreditIds(); } function addUsers($number = 100) { $result = $this->db->query("TRUNCATE Users"); $json_array = json_decode(file_get_contents("http://api.randomuser.me/?results=100")); for ($i = 0; $i < $number; $i++) {