* [misc] add addSelect.

This commit is contained in:
qixinzhi
2024-09-04 16:10:43 +08:00
committed by 代婷婷
parent 8d4caa6865
commit 93ba76eee4
+20
View File
@@ -137,6 +137,26 @@ class sqlparser
$this->statement->from = array($from);
}
/**
* Add select.
*
* @param array|object $exprs
* @access public
* @return void
*/
public function addSelect($exprs)
{
if(empty($exprs)) return;
if($exprs instanceof PhpMyAdmin\SqlParser\Components\Expression)
{
$this->statement->expr[] = $exprs;
return;
}
foreach($exprs as $expr) $this->addSelect($expr);
}
/**
* Get function.
*