Exemplo n.º 1
0
 public function testEscape()
 {
     $q = new ngfw\Query();
     $q->select()->from("TEST")->where("userid = ?", 8983)->andWhere("favorite_book = ?", "The Hitchhiker's Guide to the Galaxy");
     $this->assertEquals("SELECT * FROM `TEST` WHERE `userid` = 8983 AND `favorite_book` = 'The Hitchhiker\\'s Guide to the Galaxy'", $q->getQuery(true));
 }
Exemplo n.º 2
0
 public function testSelectDoubleOrder()
 {
     $q = new Query();
     $q->select()->from('TEST')->where('User = ?', "nick")->order("NOW()")->order("UserID", "ASC");
     $this->assertEquals('SELECT * FROM `TEST` WHERE `User` = \'nick\' ORDER BY NOW(), `UserID` ASC', $q->getQuery(true));
 }