sor*_*ive 21 php mysql codeigniter
如何在Windows和Linux中运行我在MySQL中运行的最后一个查询?
我正在使用PHP和CodeIgniter.在my_model.php,我有:
$query1 = ( ...something... );
$query2 = ( ...something... );
$variables = ( .... something .... );
$this->db->query(" $query1 ... $variables .. $query2", array( $variables, ... ));
Run Code Online (Sandbox Code Playgroud)
我需要在上面的代码片段之后执行最后一个查询.
谁能告诉我怎样才能得到我的最后一个查询?
Dam*_*rsy 50
使用:
$this->db->last_query();
Returns the last query that was run (the query string, not the result). Example:
$str = $this->db->last_query();
// Produces: SELECT * FROM sometable....
Run Code Online (Sandbox Code Playgroud)
从查询辅助函数手册中获取的示例
| 归档时间: |
|
| 查看次数: |
72070 次 |
| 最近记录: |