Ejemplo n.º 1
0
function testInsert()
{
    $query = new MysqlInsert();
    $query->insertInto('foo');
    $query->values('foo, bar, baz');
    echo $query;
    echo PHP_EOL;
    $query->columns('asdf,qwer,zxvc');
    echo $query;
    echo PHP_EOL;
    $query->onDuplicateKeyUpdate('asdf = 7');
    echo $query;
    echo PHP_EOL;
    echo PHP_EOL;
    $query = new MysqlInsert();
    $query->insertInto('foo');
    $query->set('x = y, z = 2');
    $query->set('foo = bar');
    echo $query;
    echo PHP_EOL;
    $select = new MysqlSelect();
    $select->select('*')->from('foo');
    $query = new MysqlInsert();
    $query->insertInto('foo');
    $query->select($select);
    echo $query;
    echo PHP_EOL;
}
Ejemplo n.º 2
0
 /**
  * Return the query string.
  * @ignore
  */
 public function getQueryString()
 {
     $this->insert_into = $this->replace_into;
     return MysqlInsert::getQueryString();
 }