예제 #1
0
파일: index.php 프로젝트: maof14/database
<?php

include __DIR__ . "../../src/config.php";
$title = "Database by maof14";
$db = new CDatabase($database);
// Initialize with dsn variable declared in config.
$sql = "SELECT * FROM table WHERE someColumn = ? LIMIT 0, 10";
$params[] = 'parameter';
$results = $db->executeSelectQueryAndFetchAll($sql, $params);
?>

<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title><?php 
echo $title;
?>
</title>
		<link rel="stylesheet" href="css/style.css" />
		</head>
	<body>
		<div id="container">
		<h1><a href="/database/webroot">Database test</a></h1>
		<ul>
			<?php 
foreach ($results as $result) {
    ?>
 
				<li><?php 
    echo $result->column;