restlin/yii2-query-insert

Class for Yii2 PHP framework helps to generate insert sql query from other tables.

1.0.1 2018-02-12 15:18 UTC

This package is auto-updated.

Last update: 2024-05-21 14:48:35 UTC


README

Class for Yii2 PHP framework helps to generate insert sql query from other tables.

This class helps to create query as below:

insert into rights_cache(id,login,type,date_in)
select id,login,type,now()
from rights 
where date_in>date_trunc('day',now());

Example usage:

$query = new QueryInsert;
$query->select(['login','docid'])
->from($tblTemp)
->where(['in','docid' , $docids]);
$query->insert(DA::tableName(),['login','docid']);