Exemple #1
0
<?php

namespace Framework\Utilities;

error_reporting(E_ALL);
ini_set("display_errors", 1);
include '../DatabaseFunctions.php';
echo "<h2>Testing DatabaseFunctions class</h2>";
/* Enter your database connection information. You should first import the sql file given in data folder */
$connection_information = array("host" => "localhost", "user" => "nadir", "password" => "kcbW5eFSCbPXbJGLHvUGG8T8", "database" => "dev_pakphp", "debug" => "2", "charset" => "utf8");
SelectQuery($connection_information);
UpdateQuery($connection_information);
InsertQuery($connection_information);
//DeleteQuery($connection_information);
/**
 * Used to select data from database
 * 
 * @since 1.2.2
 * @param array $connection_information an array with following keys:
 * host => the database host name
 * user => the database user
 * password => the database password
 * database => the database name
 * debug => the debug level it can be 0,1 or 2
 * charset => utf8
 */
function SelectQuery($connection_information)
{
    /** The database connection details */
    $parameters = $connection_information;
    /** The DatabaseFunctions object is created */
function FindQuestionNumInPaperByQuestionID($questionID)
{
    include_once 'sqlQuery.php';
    $query = "select QuestionNum from question\r\n    where QuestionID = {$questionID}";
    return SelectQuery($query);
}