Closed shellvon closed 7 years ago
支持表名/字段名的转义,防止SQL错误:
$miner = new Miner(); $sql = (string)$miner->select('*') ->from('shows', 'group') ->innerJoin('episodes', 'show_id') ->where('shows.network_id', 12) ->orderBy('episodes.aired_on', Miner::ORDER_BY_DESC) ->limit(20)->getStatement(false); echo $sql; // SELECT * FROM `shows` AS `group` INNER JOIN `episodes` ON `shows`.`show_id` = `episodes`.`show_id` WHERE `shows`.`network_id` = '12' ORDER BY `episodes`.`aired_on` DESC LIMIT 20
支持表名/字段名的转义,防止SQL错误: