-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
32 lines (29 loc) · 851 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
<?php
require_once 'library/php-activerecord/ActiveRecord.php';
ActiveRecord\Config::initialize(function($cfg)
{
$cfg->set_model_directory('models');
$cfg->set_connections(array('development' => 'mysql://root:@localhost/ar'));
// dsavsavsavsavafs
});
echo '<pre>';
// User::create(array(
// 'login'=>'servxg',
// 'password'=>'1234'
// ));
// Data::create(array(
// 'content'=>'new',
// ));
$data=Data::find_by_dataid(1);
$data->content='new content';
$data->save();
print_r($data);
// $user=User::find('all');
//
// $u=$user[0];
// $u->login='ara';
// $u->save();
// foreach ($user as $u)
// {
// echo $u->login.'</br>';
// }