summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-12-30 11:04:28 +0100
committerAndreas Unterkircher <unki@netshadow.at>2007-12-30 11:04:28 +0100
commite4cfdbe7da6340d8c06f797eba686797391717c6 (patch)
tree95cda2fd41bf83e8e45c05d03e1cf62c7b5f7dac
parent04b321fe02707a4c545ce8e59659edac39ae4bb1 (diff)
also show query on occuring error. helps for debugging to know which query has problems
-rw-r--r--phpfspot_db.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpfspot_db.php b/phpfspot_db.php
index 1f7d597..7d8caa0 100644
--- a/phpfspot_db.php
+++ b/phpfspot_db.php
@@ -28,6 +28,7 @@ class PHPFSPOT_DB {
private $parent;
private $is_connected;
private $last_error;
+ private $last_query;
/**
* PHPFSPOT_DB class constructor
@@ -118,6 +119,8 @@ class PHPFSPOT_DB {
public function db_query($query = "")
{
if($this->getConnStatus()) {
+
+ $this->last_query = $query;
switch($this->parent->cfg->db_access) {
case 'native':
@@ -153,6 +156,8 @@ class PHPFSPOT_DB {
{
if($this->getConnStatus()) {
+ $this->last_query = $query;
+
switch($this->parent->cfg->db_access) {
case 'native':
if(($result = sqlite3_exec($this->db, $query)) === false)
@@ -308,6 +313,7 @@ class PHPFSPOT_DB {
private function ThrowError($string)
{
if(!defined('DB_NOERROR')) {
+ print "Error during query: ". $this->last_query ."<br /><br />\n";
print "<br /><br />". $string ."<br /><br />\n";
try {
throw new Exception;