]> src.bluestatic.org Git - isso.git/blob - docs/BSDbAbstracter.php
There's no reason to make BSFunctions use a singleton. Switching it to be a purely...
[isso.git] / docs / BSDbAbstracter.php
1 <?php
2
3
4 // $db->query("SELECT f.*, m.userid, m.email FROM foo AS f LEFT JOIN members AS m WHERE ??? ORDER BY m.userid ASC GROUP BY m.userid LIMIT 10, 100");
5 $db ->select(array('f' => '*', 'm' => array('userid', 'email')))
6 ->from(array(TABLE_PREFIX . 'foo' => 'f'))
7 ->join('left', 'members', 'm')
8 ->where(array(
9
10 ))
11 ->orderBy('userid', 'asc', 'm')
12 ->groupBy('userid', 'm')
13 ->limit(10, 100);
14
15
16 // $db->query("SELECT * FROM users WHERE userid = 4");
17 $simple = $db->select('*')->from('users')->where(array('userid' => 4));
18
19 // $db->query("INSERT INTO posts (userid, email) VALUES (4, 'robert@sesek.com')");
20 $insert = $db->insert(TABLE_PREFIX . 'posts', array(
21 'userid' => 4,
22 'email' => 'robert@sesek.com'
23 ));
24
25 ?>