Asf_Db_AbstractAdapter::getLastSql

获取上一次需要执行的SQL, 绑定的Value, 常用于调试使用


Description

public array getLastSql(void)

Return Values

Return an Array, There are 2 child elements inside with the name 'sql' and 'value'.

Return an Empty Array, they are not found SQL.

Examples

Example #1

<?php
Asf_Db::findAll("SELECT user, pass from test1 where user = ? limit 2", array("'' or 1= '1'"));
var_dump(Asf_Db::getLastSql())

// result
array(2) {
  ["sql"]=> string(51) "SELECT user, pass from test1 where user = ? limit 2"
  ["value"]=>
    array(1) {
      [0]=> string(12) "'' or 1= '1'"
  }
}