Ejemplo n.º 1
0
 public function test_P_StandardInsert()
 {
     $stmt = new InsertStatement("INSERT INTO `{$this->actualSchema}`.`cities`\n\t\t\t(`country`, `name`, `postal_code`)\n\t\t\tVALUES (?, ?, ?)", 'isi');
     $countryID = 1;
     $name = 'Esbjerg';
     $postalCode = 6700;
     $stmt->bindAndExecute($values = array($countryID, $name, $postalCode));
     $insertID = $this->insertInto('cities', array('country' => $countryID, 'name' => $name, 'postal_code' => $postalCode));
     $this->assertTablesEqual('cities');
     $this->assertEquals($insertID, $stmt->insertID);
 }
 public function __get($name)
 {
     switch ($name) {
         case 'rows':
             return $this->statement->affected_rows;
         default:
             return parent::__get($name);
     }
 }