Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 772 Bytes

File metadata and controls

32 lines (26 loc) · 772 Bytes

eugene

basically just takes a delimited file and imports it into mysql.

notes/usage/whatever

define("DBINFO", "mysql:host=127.0.0.1;dbname=whatever");
define("DBUSER", "theBoss");
define("DBPASS", "whatevs");

$file = "./inventory.txt";
$options = array(
  // these first two speak for themselves
  "delimiter" => "\t", // default: "^"
  "primary_key" => "barcode", // default: "id"
  
  // table_extra is an array of any extra fields you'd like
  // to add into the table that aren't included in the file
  // (columnName => columnType)
  "table_extra" => array(
    "createdBy" => varchar(150),
    "there" => tinyint(1)
  )
);
$eugene = new Eugene($file, $options);
$eugene->setTable();

if($eugene->getErrors()) {
  print_r($eugene->getErrors());
}