|
@@ -457,6 +457,7 @@ class dao {
|
|
* @return object the dao object self.
|
|
* @return object the dao object self.
|
|
*/
|
|
*/
|
|
public function data($data) {
|
|
public function data($data) {
|
|
|
|
+// var_dump($data);
|
|
if (!is_object($data))
|
|
if (!is_object($data))
|
|
$data = (object) $data;
|
|
$data = (object) $data;
|
|
$this->sqlobj->data($data);
|
|
$this->sqlobj->data($data);
|
|
@@ -584,7 +585,7 @@ class dao {
|
|
try {
|
|
try {
|
|
$method = $this->method;
|
|
$method = $this->method;
|
|
$this->reset();
|
|
$this->reset();
|
|
- var_dump($sql);
|
|
|
|
|
|
+// var_dump($sql);
|
|
if ($this->slaveDBH and $method == 'select') {
|
|
if ($this->slaveDBH and $method == 'select') {
|
|
return $this->slaveDBH->query($sql);
|
|
return $this->slaveDBH->query($sql);
|
|
} else {
|
|
} else {
|
|
@@ -650,6 +651,7 @@ class dao {
|
|
public function exec($sql = '') {
|
|
public function exec($sql = '') {
|
|
if (!empty(dao::$errors))
|
|
if (!empty(dao::$errors))
|
|
return new PDOStatement(); // If any error, return an empty statement object to make sure the remain method to execute.
|
|
return new PDOStatement(); // If any error, return an empty statement object to make sure the remain method to execute.
|
|
|
|
+// var_dump($sql);
|
|
if ($sql) {
|
|
if ($sql) {
|
|
if (is_null($this->sqlobj)) {
|
|
if (is_null($this->sqlobj)) {
|
|
$this->sqlobj = sql::factory();
|
|
$this->sqlobj = sql::factory();
|
|
@@ -658,7 +660,6 @@ class dao {
|
|
}
|
|
}
|
|
$sql = $this->processSQL();
|
|
$sql = $this->processSQL();
|
|
|
|
|
|
-// var_dump($sql);
|
|
|
|
try {
|
|
try {
|
|
$this->reset();
|
|
$this->reset();
|
|
return $this->dbh->exec($sql);
|
|
return $this->dbh->exec($sql);
|
|
@@ -1287,7 +1288,9 @@ class sql {
|
|
* @return object the sql object.
|
|
* @return object the sql object.
|
|
*/
|
|
*/
|
|
public function data($data) {
|
|
public function data($data) {
|
|
- $data = (object) $data;
|
|
|
|
|
|
+// var_dump($data);
|
|
|
|
+ loyalsoft\DebugHelper::
|
|
|
|
+ $data = (object) $data;
|
|
|
|
|
|
foreach ($data as $field => $value) {
|
|
foreach ($data as $field => $value) {
|
|
if (!preg_match('|^\w+$|', $field)) {
|
|
if (!preg_match('|^\w+$|', $field)) {
|