Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created August 31, 2012 16:23
Show Gist options
  • Select an option

  • Save pippinsplugins/3555363 to your computer and use it in GitHub Desktop.

Select an option

Save pippinsplugins/3555363 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Newton Police PHP to Access
Description: Inserts form data from the website into the access databases
Author: Pippin Williamson
Version: 1.0
*/
function test_db() {
if( isset( $_GET['db'] ) ) {
$dbName = $_SERVER["DOCUMENT_ROOT"] . "products\\products.mdb";
echo $dbName; exit;
if (!file_exists($dbName)) {
die("Could not find database file.");
}
$db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$dbName; Uid=; Pwd=;");
}
}
add_action('init', 'test_db');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment