Esempio n. 1
0
<?php

/**
 *
 * Test file for the access "layer"
 *
 * THIS DOES NOT WORK
 *
 * We need to specify the database type which should be
 * used with odbc, like odbc_mssql, odbc_db2, etc.
 * The ways for fetching field names, getting the insert id, etc
 * is to different for each type.
 *
 * @package Yadal
 */
include '../class.Yadal.php';
// the test table (can be any table)
$table = "Customers";
echo "<pre>";
// create a new connection
$db = newYadal("Northwind", "odbc");
$db->connect('ODBCTEST', '', '');
print_var($db->getFieldNames($table));
// start the test secuence
//include( 'test.php' );
Esempio n. 2
0
 /**
  * dbFormHandler::setConnectionResource()
  *
  * Use an already opened connection instead of opening a new one.
  *
  * @param resource $conn:
  * @param string $table: The table which should be used to save the data in
  * @param string type: The type of database you are using
  * @return void
  * @access public
  * @author Teye Heimans
  */
 function setConnectionResource($conn, $table = null, $type = null)
 {
     require_once FH_YADAL_DIR . 'class.Yadal.php';
     // if no db-type is given, set the default
     if (is_null($type)) {
         $type = FH_DEFAULT_DB_TYPE;
     }
     // make this function backwards compatible ( $table, $conn, $type  as arguments )
     if (is_string($conn) && is_resource($table)) {
         $tmp = $table;
         unset($table);
         $table = $conn;
         unset($conn);
         $conn = $tmp;
         unset($tmp);
     }
     // save the table name
     $this->_table = $table;
     // create the yadal object
     $this->_db = newYadal(null, $type);
     // set the sql resource which we should use
     $this->_db->setConnectionResource($conn);
     // try to fetch the database data already
     if ($this->edit) {
         $this->_loadDbData();
     }
 }
Esempio n. 3
0
<?php

/**
 * Test file for the access "layer"
 *
 * @package Yadal
 */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
include '../class.Yadal.php';
// the test table (can be any table)
$table = "Employee";
echo "<pre>";
// create a new connection
$db = newYadal(realpath('.') . "/employees.mdb", "access");
$conn = $db->connect();
// start the test secuence
include 'test.php';
Esempio n. 4
0
<?php

/**
 * Test file for the mssql "layer"
 *
 * @package Yadal
 */
include '../class.Yadal.php';
// the test table (can be any table)
$table = "orders";
echo "<pre>";
// create a new connection
$db = newYadal("Northwind", "mssql");
$db->connect('TEYELAPTOP', '', '');
// start the test secuence
include 'test.php';
Esempio n. 5
0
<?php

/**
 * Test file for the mysql "layer"
 *
 * @package Yadal
 */
include '../class.Yadal.php';
// the test table (can be any table)
$table = "criteria";
echo "<pre>";
// create a new connection
$db = newYadal("assessment", "mysql");
$db->connect('localhost', 'root', '');
// start the test secuence
include 'test.php';
Esempio n. 6
0
<?php

/**
 * Test file for the postgreSQL "layer"
 *
 * @package Yadal
 */
include '../class.Yadal.php';
// the test table (can be any table)
$table = "persoon";
echo "<pre>";
// create a new connection
$db = newYadal('assessment', 'postgresql');
$db->connect('localhost', 'root', 'development');
// start the test secuence
include 'test.php';