当前位置: 首页>>代码示例>>PHP>>正文


PHP sql_query::fetch_affected_rows方法代码示例

本文整理汇总了PHP中sql_query::fetch_affected_rows方法的典型用法代码示例。如果您正苦于以下问题:PHP sql_query::fetch_affected_rows方法的具体用法?PHP sql_query::fetch_affected_rows怎么用?PHP sql_query::fetch_affected_rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sql_query的用法示例。


在下文中一共展示了sql_query::fetch_affected_rows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: time

 function log_retention_clean()
 {
     log_write("debug", "changelog", "Executing log_retention_clean()");
     log_write("debug", "changelog", "A retention clean is required - last one was more than 24 hours ago.");
     // calc date to clean up to
     $clean_time = time() - $GLOBALS["config"]["LOG_RETENTION_PERIOD"] * 86400;
     $clean_date = time_format_humandate($clean_time);
     // clean
     $obj_sql_clean = new sql_query();
     $obj_sql_clean->string = "DELETE FROM logs WHERE timestamp <= '{$clean_time}'";
     $obj_sql_clean->execute();
     $clean_removed = $obj_sql_clean->fetch_affected_rows();
     unset($obj_sql_clean);
     // update rentention time check
     $obj_sql_clean = new sql_query();
     $obj_sql_clean->string = "UPDATE `config` SET value='" . time() . "' WHERE name='LOG_RETENTION_CHECKTIME' LIMIT 1";
     $obj_sql_clean->execute();
     unset($obj_sql_clean);
     // add audit entry - we have to set the LOG_RETENTION_CHECKTIME variable here to avoid
     // looping the program, as the SQL change above won't be applied until the current transaction
     // is commited.
     $GLOBALS["config"]["LOG_RETENTION_CHECKTIME"] = time();
     $this->log_post("audit", "Automated log retention clean completed, removed {$clean_removed} records order than {$clean_date}");
     // complete
     log_write("debug", "changelog", "Completed retention log clean, removed {$clean_removed} log records older than {$clean_date}");
     return 1;
 }
开发者ID:claybbs,项目名称:namedmanager,代码行数:27,代码来源:inc_changelog.php


注:本文中的sql_query::fetch_affected_rows方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。