Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 515c66a3db9d325d583749a99331e73f > files > 15

php-pear-RDF-0.1.0-0.alpha1.1mdv2010.0.noarch.rpm

<?php 
// ----------------------------------------------------------------------------------
// PHP Script: test_SetDatabaseConnection.php
// ----------------------------------------------------------------------------------
/*
 * This is an online demo of RAP's database backend.
 * Tutorial how to connect to different databases and how to create tables.
 *
 * @author Radoslaw Oldakowski <radol@gmx.de>
 */
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Test Store Models in Database</title>
</head>
<body>

<?php 
// Include RAP
include 'RDF.php';
include 'RDF/Store/MDB.php';
// # 1. Connect to MsAccess database (via ODBC) and create tables.
// Connect to MsAccess (rdf_db DSN) database using connection settings
// defined in constants.php :
// ----------------------------------------------------------------------------------
// Database
// ----------------------------------------------------------------------------------

// Connect to MySQL database with user defined connection settings
$rdf_database =& new RDF_Store_MDB(
    array(
        'phptype' => 'mysql',
        'username' => 'root',
        'password' => '',
        'hostspec' => 'localhost',
        'database' => 'rdf2'
    ), array());

// Create tables for MySQL
var_dump($rdf_database->createTables());

// Close the connection
$rdf_database->close();

?>
</body>
</html>