<?php error_reporting(E_ALL); ini_set('display_error', 1); ini_set('memory_limit', '-1'); require_once '../common/config.inc'; require_once 'Loans.class.php'; date_default_timezone_set('UTC'); // create the database object try { $database = new PDO("mysql:host={$db_host};dbname={$db_name}", $db_user, $db_password); $database->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $statement = $database->prepare("TRUNCATE TABLE kiva_loans"); $statement->execute(); $statement = $database->prepare("SET CHARACTER SET 'utf8mb4'"); $statement->execute(); } catch (PDOException $ex) { die("Error : " . $ex->getMessage()); } $loans = new Loans(); $loans->initialize($database); $loans->create();