Skip to end of metadata
Go to start of metadata
CiviCRM Documentation

This page refers to outdated version of CiviCRM. Check current version of documentation.

Query Debugging

In order to debug a query problem - such as unexpected duplicate rows returned by searches - you may need to see the actual queries that CiviCRM is sending to your database.

Two different approaches to this are:

  • Enable MySQL Query Logging - Add log=/var/log/mysqld.log to my.cnf and restart your MySQL server. Check out the MySQL documentation for more information.
  • Add Debug Code to CiviCRM - Add a debug statement to echo the queries in packages/DB/DataObject.php, function _query (line 2280 or so)
Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.