Skip to content

TrexlerLibrary/eugene

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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());
}

About

inserting delimited files into a mysql db

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published