Added Email Logging for Emailnotification class
This commit is contained in:
+34
-12
@@ -201,7 +201,7 @@ class FronkDB {
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function insert($_table, $_data, $_forcestr = array(), $options = array()) {
|
||||
public function insert($_table, $_data, $_forcestr = array(), $_forcebinary = array()) {
|
||||
if(empty($_table)) {
|
||||
$this->lastError = "Error constructing INSERT: tablename ommited";
|
||||
return false;
|
||||
@@ -225,13 +225,19 @@ class FronkDB {
|
||||
$_Q = "";
|
||||
}
|
||||
}
|
||||
if($v === null) {
|
||||
$_Q = '';
|
||||
$v = "NULL";
|
||||
}
|
||||
|
||||
$fields .= ",`$f`";
|
||||
$values .= "," . $_Q . $v . $_Q;
|
||||
|
||||
if($v === null) {
|
||||
$values .= ", NULL";
|
||||
} else {
|
||||
if(in_array($f, $_forcebinary)) {
|
||||
$values .= ", _binary" . $_Q . $v . $_Q;
|
||||
} else {
|
||||
$values .= "," . $_Q . $v . $_Q;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$fields = preg_replace('/^,/', '', $fields);
|
||||
@@ -246,7 +252,7 @@ class FronkDB {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update($_table, $_data, $_where, $_forcestr = array()) {
|
||||
public function update($_table, $_data, $_where, $_forcestr = array(), $_forcebinary = array()) {
|
||||
if(empty($_table)) {
|
||||
$this->lastError = "Error constructing UPDATE: tablename ommited";
|
||||
return false;
|
||||
@@ -276,12 +282,16 @@ class FronkDB {
|
||||
$_Q = '';
|
||||
}
|
||||
}
|
||||
if($v === null) {
|
||||
$_Q = '';
|
||||
$v = "NULL";
|
||||
}
|
||||
|
||||
$Pairs .= ", `$f`=" . $_Q . $v . $_Q;
|
||||
if($v === null) {
|
||||
$Pairs .= ", `$f`=NULL";
|
||||
} else {
|
||||
if(in_array($f, $_forcebinary)) {
|
||||
$Pairs .= ", `$f`= _binary " . $_Q . $v . $_Q;
|
||||
} else {
|
||||
$Pairs .= ", `$f`=" . $_Q . $v . $_Q;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Pairs = preg_replace('/^,/', '', $Pairs);
|
||||
@@ -361,4 +371,16 @@ class FronkDB {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function startTransaction() {
|
||||
$this->query("START TRANSACTION");
|
||||
}
|
||||
|
||||
public function commitTransaction() {
|
||||
$this->query("COMMIT");
|
||||
}
|
||||
|
||||
public function rollbackTransaction() {
|
||||
$this->query("ROLLBACK");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user