Asf_Db_QueryBuilder_Insert


Introduction

Db Query Builder Insert

在开启命名空间情况下(asf.use_namespace=1)类名为 Asf\Db\QueryBuilder\Insert

Class synopsis

<?php
final class Asf_Db_QueryBuilder_Insert extends Asf_Db_AbstractQueryBuilder
{
    public function __construct([bool $ignore = false])
    /* alias __construct */
    public function insert([bool $ignore = false])
    public function onDku(string $columns, mixed $value)
}

Examples

Example #1 Asf_Db_QueryBuilder_Insert::insert

<?php
$insert = new Asf_Db_QueryBuilder_Insert();

$insert->table('test')->set('user', 'lisi2');

Example #2 Asf_Db_QueryBuilder_Insert::onDku

<?php
// string(125) "[SQL] INSERT IGNORE INTO `test` SET `user` = ? , `pass` = ? ON DUPLICATE KEY UPDATE `status` = 1 [BVALUES] user+1 , 123456"

$insert = new Asf_Db_QueryBuilder_Insert();
$insert->table('test')->set('user', 'user+1')->set('pass', 123456)->ondku('status', 1);