<?php

require 'database.php';
Database::setUsername('root');
Database::setPassword('');
Database::setHostname('localhost');
Database::setDatabase('test');
Database::setDBLink('default');
Database::connect();
$rowSingleAccount1 = Database::fetch("SELECT * FROM account WHERE id = :id", [['id', 1, 'int']]);
$rowSingleAccount2 = Database::fetch("SELECT * FROM account WHERE id = :id", [['id', 1, 'int']]);
echo '<pre>';
print_r($rowSingleAccount1);
print_r($rowSingleAccount2);
echo '</pre>';
$rowMultiAccount = Database::fetchAll("SELECT * FROM account");
echo '<pre>';
print_r($rowMultiAccount);
echo '</pre>';
// $fullname = 'Peter';
// Database::exec("INSERT INTO account(fullname)
// VALUES(:fullname)", [
// 	['fullname', $fullname, 'str']
// ]);
echo '<hr />';
echo '<pre>';
print_r(Database::getStatistics());
echo '</pre>';
Example #2
0
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>PHP Analyzer report</title>
  <link rel="stylesheet" type="text/css" href="style.css">
  <script type="text/javascript" src="js/script.js"></script>
  <script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
<h1>Analysis report - PHP Analyzer</h1>

<h2>Statistics</h2>
<?php 
$stats = Database::getStatistics();
?>
<table>
  <tr>
    <td>Number of files examined</td>
    <td><?php 
echo $stats['number_of_files'];
?>
</td>
  </tr>
  <tr>
    <td>Number of units</td>
    <td><?php 
echo $stats['number_of_units'];
?>
</td>