Example #1
0
function getSourceList()
{
    $conn = getconnection("ibabymall");
    $ary = array();
    $sql = "SELECT * FROM `source` ORDER BY `source_id` ASC";
    $result = mysql_query($sql, $conn) or die('MySQL query error ' . mysql_error() . ' ' . $sql);
    while ($row = mysql_fetch_array($result)) {
        $ary[$row[0]] = $row[1];
    }
    mysql_free_result($result);
    return $ary;
}
Example #2
0
 public function testRemove()
 {
     $conn = getconnection();
     $users = $conn->getcollection('user');
     $total = $users->query()->count();
     $this->assertTrue($total > 0);
     $users->query()->remove();
     $total = $users->query()->count();
     $this->assertEquals($total, 0);
 }
Example #3
0
 public function testDoubleReference()
 {
     $x = new Foo();
     $x->x = 1;
     $x->bar = new Foo();
     $x->save();
     $this->assertTrue(getconnection()->getCollection('Foo')->is($x->bar));
 }