-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
44 lines (34 loc) · 928 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
$config = array_merge(
require_once './config_env.php',
require_once './config.php'
);
echo "<pre>";
print_r($config);
echo "</pre>";
// @TODO: spl autoload
// @TODO: чем отличается array_merge от array_replace
// @TODO: экранировать кавычки ипараметризация
function __autoload($className)
{
if (file_exists('./core/classes/'.$className.'.php')) {
require_once './core/classes/'.$className.'.php';
return true;
}
return false;
}
//require_once 'core/classes/interfaceDb.php';
//
// SELECT * FROM pages
// WHERE uri = 'about'
// AND published_at <= NOW()
// AND (published_until IS NULL OR published_until >= NOW())
$connect = new Db($config['db_connect']);
//$db->connect($config['db_connect']);
$connect->query(
"SELECT * FROM table WHERE name = #name# AND field = #field#",
[
'name' => "Hello ' #field#",
'field' => "world"
]
);