ADOdb: Log Query



Like its name, log query used for record all query that ever request. So, you can monitor all activity that your web visitor do. Function for recording query activity is logSQL().

<?
include ("adodb/adodb.inc.php");
include ("adodb/toexport.inc.php");

$db = ADONewConnection('mysql');
$db->Connect('localhost','root','pass','employee');

$sql = "SELECT * FROM staff";
$db->LogSQL();
$rs  = &$db->Execute($sql);
echo "<Pre>";
echo rs2cvs($rs);
echo "</Pre>";
$db->LogSQL(false);
$db->Close();
?>

Data log you can find at table adodb_logsql. If not exist, ADOdb will create automatically for you.



Series this article:
ADOdb: Introduction
ADOdb: Connection Statement
ADOdb: Advance Select Statement
ADOdb: How to show tables
ADOdb: How to show fields
ADOdb: How to show databases
ADOdb: Caching of Recordset
ADOdb: Recordset to HTML
ADOdb: Multi Database Connection
ADOdb: Data Dictionary
ADOdb: Quick Export Data
ADOdb: Insert data style
ADOdb: Replace Data
ADOdb: Log Query
PHP ADOdb: Understanding Pivot Table For Reporting
PHP ADOdb: Creating Pivot Table
PHP ADOdb: Creating Query to Build Pivot Table


Tag: adodb, database, database layer Category: PHP Database Post : October 31st 2007 Read: 6,000 Bookmark and Share

blog comments powered by Disqus