From 2057df192461f42736f81319dcea7f31623cbaf4 Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Fri, 23 Sep 2022 20:09:22 -0500 Subject: [PATCH 01/11] missing scroll bar on documentation page sidebar --- documentation/assets/style.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/documentation/assets/style.css b/documentation/assets/style.css index ebf2035..2662ff9 100644 --- a/documentation/assets/style.css +++ b/documentation/assets/style.css @@ -53,7 +53,8 @@ a:hover { .navbar { border-radius: 0; clear: both; - margin-bottom: 0 + margin-bottom: 0; + overflow-y: auto; } .navbar-default { From 8bbb4354c0a5714957958b3d39125c8c3ab4c90a Mon Sep 17 00:00:00 2001 From: Giandonato Inverso <70962472+giandonatoinverso@users.noreply.github.com> Date: Sat, 24 Sep 2022 03:23:20 +0200 Subject: [PATCH 02/11] Update environment.php --- qrcode/config/environment.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qrcode/config/environment.php b/qrcode/config/environment.php index 4dcf888..a5064cf 100644 --- a/qrcode/config/environment.php +++ b/qrcode/config/environment.php @@ -12,7 +12,6 @@ if(is_string($docker_cid)) { define('DATABASE_NAME', Getenv('DATABASE_NAME')); define('DATABASE_USER', Getenv('DATABASE_USER')); define('DATABASE_PASSWORD', Getenv('DATABASE_PASSWORD')); - define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX')); define('DATABASE_CHARSET', Getenv('DATABASE_CHARSET')); } else { define('DATABASE_HOST', "localhost"); @@ -20,7 +19,6 @@ if(is_string($docker_cid)) { define('DATABASE_NAME', "qrcode"); define('DATABASE_USER', "root"); define('DATABASE_PASSWORD', "root"); - define('DATABASE_PREFIX', ""); define('DATABASE_CHARSET', "utf8"); } /* @@ -29,4 +27,4 @@ if(is_string($docker_cid)) { |-------------------------------------------------------------------------- */ -?> \ No newline at end of file +?> From 418215cd23d1144c3f019ed4faaec49c33d8f57e Mon Sep 17 00:00:00 2001 From: Giandonato Inverso <70962472+giandonatoinverso@users.noreply.github.com> Date: Sat, 24 Sep 2022 03:23:41 +0200 Subject: [PATCH 03/11] Update docker-compose.yml --- docker/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a9c1932..a008e8f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -23,7 +23,6 @@ services: DATABASE_NAME: "qrcode" DATABASE_USER: "qrcode" DATABASE_PASSWORD: "changeme" - DATABASE_PREFIX: "" DATABASE_CHARSET: "utf8" volumes: - ./data/app/config:/var/www/html/config From a8e4cf18ffd8545485e4652d55348dc99c96f37b Mon Sep 17 00:00:00 2001 From: Giandonato Inverso <70962472+giandonatoinverso@users.noreply.github.com> Date: Sat, 24 Sep 2022 03:24:15 +0200 Subject: [PATCH 04/11] Update config.php --- qrcode/config/config.php | 1 - 1 file changed, 1 deletion(-) diff --git a/qrcode/config/config.php b/qrcode/config/config.php index cea86f7..8312259 100755 --- a/qrcode/config/config.php +++ b/qrcode/config/config.php @@ -30,6 +30,5 @@ function getDbInstance() { 'password' => DATABASE_PASSWORD, 'db'=> DATABASE_NAME, 'port' => DATABASE_PORT, - 'prefix' => DATABASE_PREFIX, 'charset' => DATABASE_CHARSET)); } From b80636049f8898daccfca98070e252b1bd404ff5 Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Fri, 23 Sep 2022 20:55:55 -0500 Subject: [PATCH 05/11] Issue #30: Fixes database_prefix option during install --- qrcode/config/environment.php | 6 +++++- qrcode/install/includes/database_class.php | 5 ++++- qrcode/install/setup.php | 2 +- qrcode/install/sql/sample_data.sql | 12 ++++++------ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/qrcode/config/environment.php b/qrcode/config/environment.php index 4dcf888..785bf8d 100644 --- a/qrcode/config/environment.php +++ b/qrcode/config/environment.php @@ -12,6 +12,8 @@ if(is_string($docker_cid)) { define('DATABASE_NAME', Getenv('DATABASE_NAME')); define('DATABASE_USER', Getenv('DATABASE_USER')); define('DATABASE_PASSWORD', Getenv('DATABASE_PASSWORD')); + // This must have a trailing underscore. + // Example: qr_ define('DATABASE_PREFIX', Getenv('DATABASE_PREFIX')); define('DATABASE_CHARSET', Getenv('DATABASE_CHARSET')); } else { @@ -20,7 +22,9 @@ if(is_string($docker_cid)) { define('DATABASE_NAME', "qrcode"); define('DATABASE_USER', "root"); define('DATABASE_PASSWORD', "root"); - define('DATABASE_PREFIX', ""); + // This must have a trailing underscore. + // Example: qr_ + define('DATABASE_PREFIX', "qr_"); define('DATABASE_CHARSET', "utf8"); } /* diff --git a/qrcode/install/includes/database_class.php b/qrcode/install/includes/database_class.php index e58f3b2..3d191eb 100644 --- a/qrcode/install/includes/database_class.php +++ b/qrcode/install/includes/database_class.php @@ -31,7 +31,7 @@ class Database { } // Function to create the tables and fill them with the default data - function create_tables($db_host, $db_user, $db_password, $db_name, $db_port) + function create_tables($db_host, $db_user, $db_password, $db_name, $db_port, $db_prefix) { // Connect to the database $mysqli = new mysqli($db_host,$db_user,$db_password,$db_name, $db_port); @@ -43,6 +43,9 @@ class Database { // Open the default SQL file $query = file_get_contents('sql/sample_data.sql'); + // Run prefix regex; if none is set, then it will replace #prefix# with an empty string. + $query = preg_replace('/#prefix#/', $db_prefix, $query); + // Execute a multi query $mysqli->multi_query($query); diff --git a/qrcode/install/setup.php b/qrcode/install/setup.php index f16f6ee..4439840 100644 --- a/qrcode/install/setup.php +++ b/qrcode/install/setup.php @@ -51,7 +51,7 @@ if (!$database->create_database(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, echo "The database could not be created, please check your database credentials!"; die(); } -else if (!$database->create_tables(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT)) { +else if (!$database->create_tables(DATABASE_HOST, DATABASE_USER, DATABASE_PASSWORD, DATABASE_NAME, DATABASE_PORT, DATABASE_PREFIX)) { echo "The database tables could not be created, please check your database credentials!"; die(); } diff --git a/qrcode/install/sql/sample_data.sql b/qrcode/install/sql/sample_data.sql index 83a1f3a..72d6c87 100644 --- a/qrcode/install/sql/sample_data.sql +++ b/qrcode/install/sql/sample_data.sql @@ -26,7 +26,7 @@ SET time_zone = "+00:00"; -- Struttura della tabella `admin_accounts` -- -CREATE TABLE IF NOT EXISTS `admin_accounts` ( +CREATE TABLE IF NOT EXISTS `#prefix#admin_accounts` ( `id` int(25) NOT NULL AUTO_INCREMENT, `user_name` varchar(50) NOT NULL, `password` varchar(255) NOT NULL, @@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS `admin_accounts` ( -- Dump dei dati per la tabella `admin_accounts` -- -INSERT INTO `admin_accounts` (`id`, `user_name`, `password`, `series_id`, `remember_token`, `expires`, `admin_type`) VALUES +INSERT INTO `#prefix#admin_accounts` (`id`, `user_name`, `password`, `series_id`, `remember_token`, `expires`, `admin_type`) VALUES (1, 'superadmin', '$2y$10$xpZc5KC.aU2XHkcqhuZGFuAnqmtL4Unt8MysOyylceq.19XIyoZpG', 'F5V8N81eQKYJbiyj', '$2y$10$MRWA31CVjAmtrojbm4r18ezDfqC3msAxzJ1ZdbyoRpD5pxF3IdJG6', '2020-09-30 16:19:08', 'super'); -- -------------------------------------------------------- @@ -51,7 +51,7 @@ INSERT INTO `admin_accounts` (`id`, `user_name`, `password`, `series_id`, `remem -- Struttura della tabella `dynamic_qrcodes` -- -CREATE TABLE IF NOT EXISTS `dynamic_qrcodes` ( +CREATE TABLE IF NOT EXISTS `#prefix#dynamic_qrcodes` ( `id` int(10) NOT NULL AUTO_INCREMENT, `filename` varchar(45) NOT NULL, `format` varchar(45) DEFAULT NULL, @@ -71,7 +71,7 @@ CREATE TABLE IF NOT EXISTS `dynamic_qrcodes` ( -- Dump dei dati per la tabella `dynamic_qrcodes` -- -INSERT INTO `dynamic_qrcodes` (`id`, `filename`, `format`, `identifier`, `link`, `qrcode`, `scan`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES +INSERT INTO `#prefix#dynamic_qrcodes` (`id`, `filename`, `format`, `identifier`, `link`, `qrcode`, `scan`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES (1, 'Facebook', 'png', 'rcCeC', 'https://facebook.com', 'Facebook.png', 0, 'enable', 0, '2020-09-01 15:35:13', 0, NULL), (2, 'Amazon', 'png', 'F7GOY6', 'https://amazon.com', 'Amazon.png', 0, 'enable', 0, '2020-09-01 15:40:34', 0, NULL), (3, 'Youtube', 'png', '8dK5Nd', 'https://youtube.com', 'Youtube.png', 0, 'enable', 0, '2020-09-01 15:41:43', 0, NULL), @@ -85,7 +85,7 @@ INSERT INTO `dynamic_qrcodes` (`id`, `filename`, `format`, `identifier`, `link`, -- Struttura della tabella `static_qrcodes` -- -CREATE TABLE IF NOT EXISTS `static_qrcodes` ( +CREATE TABLE IF NOT EXISTS `#prefix#static_qrcodes` ( `id` int(10) NOT NULL AUTO_INCREMENT, `filename` varchar(45) CHARACTER SET utf8 NOT NULL, `format` varchar(45) DEFAULT NULL, @@ -104,7 +104,7 @@ CREATE TABLE IF NOT EXISTS `static_qrcodes` ( -- Dump dei dati per la tabella `static_qrcodes` -- -INSERT INTO `static_qrcodes` (`id`, `filename`, `format`, `type`, `content`, `qrcode`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES +INSERT INTO `#prefix#static_qrcodes` (`id`, `filename`, `format`, `type`, `content`, `qrcode`, `state`, `created_by`, `created_at`, `updated_by`, `updated_at`) VALUES (1, 'Text qr code', 'png', 'text', 'Text: My first text', 'Text qr code.png', 'enable', 0, '2020-08-24 08:41:31', 0, NULL), (2, 'Email', 'jpg', 'email', 'Email: assistance@domain.com
Subject: Assistance request
Message: Regarding my order N ° ... I require assistance', 'Email.jpg', 'enable', 0, '2020-08-24 08:44:13', 0, NULL), (3, 'Call me', 'png', 'phone', 'Phone number: 12563776756', 'Call me.png', 'enable', 0, '2020-08-24 08:45:10', 0, NULL), From 8f053474e75d7e7abc9aa82818fcca36464277cb Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Fri, 23 Sep 2022 21:00:41 -0500 Subject: [PATCH 06/11] added in prefix by default, oops. --- qrcode/config/environment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qrcode/config/environment.php b/qrcode/config/environment.php index 785bf8d..84b6604 100644 --- a/qrcode/config/environment.php +++ b/qrcode/config/environment.php @@ -24,7 +24,7 @@ if(is_string($docker_cid)) { define('DATABASE_PASSWORD', "root"); // This must have a trailing underscore. // Example: qr_ - define('DATABASE_PREFIX', "qr_"); + define('DATABASE_PREFIX', ""); define('DATABASE_CHARSET', "utf8"); } /* From 70ec7afc9087ac56fd0bb260297bb5ce9e65b1a0 Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Fri, 23 Sep 2022 22:59:53 -0500 Subject: [PATCH 07/11] some queries are manually entered, which aren't picked up by 'prefix' class attribute in database class --- qrcode/index.php | 6 +++--- qrcode/lib/Dynamic_Qrcode/Dynamic_Qrcode.php | 4 ++-- qrcode/lib/Static_Qrcode/Static_Qrcode.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qrcode/index.php b/qrcode/index.php index edef321..6eb8455 100644 --- a/qrcode/index.php +++ b/qrcode/index.php @@ -25,12 +25,12 @@ $numQrcode_static = $db->getValue ("static_qrcodes", "count(*)"); $total = $numQrcode_dynamic + $numQrcode_static; //Get Total scan -$numScan = $db->query("SELECT sum(scan) FROM dynamic_qrcodes"); +$numScan = $db->query("SELECT sum(scan) FROM ".DATABASE_PREFIX."dynamic_qrcodes"); /* CREATED CHART *///I initialize the variables that will contain the daily values to 0 otherwise in the foreach loop they will be reset every time //Get the number of DYNAMIC qr code created in 7 days and total scan -$createdQrcode_dynamic = $db->query("select `created_at`, `scan` from dynamic_qrcodes where `created_at` > curdate()-7;"); +$createdQrcode_dynamic = $db->query("select `created_at`, `scan` from ".DATABASE_PREFIX."dynamic_qrcodes where `created_at` > curdate()-7;"); $dynamic_today = $dynamic_oneday = $dynamic_twoday = $dynamic_threeday = $dynamic_fourday = $dynamic_fiveday = $dynamic_sixday = 0; $scan_today = $scan_oneday = $scan_twoday = $scan_threeday = $scan_fourday = $scan_fiveday = $scan_sixday = 0; @@ -49,7 +49,7 @@ foreach ($createdQrcode_dynamic as $row) { /* SCAN CHART */ //Get the number of STATIC qr code created in 7 days -$createdQrcode_static = $db->query("select `created_at` from static_qrcodes where `created_at` > curdate()-7;"); +$createdQrcode_static = $db->query("select `created_at` from ".DATABASE_PREFIX."static_qrcodes where `created_at` > curdate()-7;"); $static_today = $static_oneday = $static_twoday = $static_threeday = $static_fourday = $static_fiveday = $static_sixday = 0; foreach ($createdQrcode_static as $row) { diff --git a/qrcode/lib/Dynamic_Qrcode/Dynamic_Qrcode.php b/qrcode/lib/Dynamic_Qrcode/Dynamic_Qrcode.php index 3c4f3cb..6b45630 100644 --- a/qrcode/lib/Dynamic_Qrcode/Dynamic_Qrcode.php +++ b/qrcode/lib/Dynamic_Qrcode/Dynamic_Qrcode.php @@ -149,7 +149,7 @@ class Dynamic_Qrcode $dynamic_id = htmlspecialchars($_GET['dynamic_id'], ENT_QUOTES, 'UTF-8'); // get dynamic id $old_filename = htmlspecialchars($_GET['filename'], ENT_QUOTES, 'UTF-8'); // get filename - $query = $db->query("SELECT format FROM dynamic_qrcodes WHERE id=$dynamic_id"); // get format + $query = $db->query("SELECT format FROM ".DATABASE_PREFIX."dynamic_qrcodes WHERE id=$dynamic_id"); // get format $format = $query[0]['format']; $data_to_db = $this->collect(); @@ -190,7 +190,7 @@ class Dynamic_Qrcode $db = getDbInstance(); - $query = $db->query("SELECT format FROM dynamic_qrcodes WHERE id=$dynamic_id"); + $query = $db->query("SELECT format FROM ".DATABASE_PREFIX."dynamic_qrcodes WHERE id=$dynamic_id"); $format = $query[0]['format']; $db->where('id', $dynamic_id); diff --git a/qrcode/lib/Static_Qrcode/Static_Qrcode.php b/qrcode/lib/Static_Qrcode/Static_Qrcode.php index c87bf46..6cf1f60 100644 --- a/qrcode/lib/Static_Qrcode/Static_Qrcode.php +++ b/qrcode/lib/Static_Qrcode/Static_Qrcode.php @@ -445,7 +445,7 @@ class Static_Qrcode $static_id = htmlspecialchars($_GET['static_id'], ENT_QUOTES, 'UTF-8'); $old_filename = htmlspecialchars($_GET['filename'], ENT_QUOTES, 'UTF-8'); - $query = $db->query("SELECT format FROM static_qrcodes WHERE id=$static_id"); // get format + $query = $db->query("SELECT format FROM ".DATABASE_PREFIX."static_qrcodes WHERE id=$static_id"); // get format $format = $query[0]['format']; $data_to_db = $this->collect(); @@ -487,7 +487,7 @@ class Static_Qrcode $db = getDbInstance(); - $query = $db->query("SELECT format FROM static_qrcodes WHERE id=$static_id"); // get format + $query = $db->query("SELECT format FROM ".DATABASE_PREFIX."static_qrcodes WHERE id=$static_id"); // get format $format = $query[0]['format']; $db->where('id', $static_id); From a0944afd3c2c6f53c6b66955591b89bd43e6b722 Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Fri, 23 Sep 2022 23:02:05 -0500 Subject: [PATCH 08/11] if this feature is accepted in Pull Request, will need to add this back --- qrcode/config/config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/qrcode/config/config.php b/qrcode/config/config.php index 8312259..cea86f7 100755 --- a/qrcode/config/config.php +++ b/qrcode/config/config.php @@ -30,5 +30,6 @@ function getDbInstance() { 'password' => DATABASE_PASSWORD, 'db'=> DATABASE_NAME, 'port' => DATABASE_PORT, + 'prefix' => DATABASE_PREFIX, 'charset' => DATABASE_CHARSET)); } From 5e531f4e15afde793d9a4807448a66512b392b62 Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Fri, 23 Sep 2022 23:44:01 -0500 Subject: [PATCH 09/11] updated MysqliDb class functions to handle prefix properly. --- qrcode/lib/MysqliDb/MysqliDb.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qrcode/lib/MysqliDb/MysqliDb.php b/qrcode/lib/MysqliDb/MysqliDb.php index d44dca7..b01e8c6 100644 --- a/qrcode/lib/MysqliDb/MysqliDb.php +++ b/qrcode/lib/MysqliDb/MysqliDb.php @@ -727,7 +727,7 @@ class MysqliDb $column = is_array($columns) ? implode(', ', $columns) : $columns; - if (strpos($tableName, '.') === false) { + if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { $this->_tableName = self::$prefix . $tableName; } else { $this->_tableName = $tableName; @@ -761,6 +761,10 @@ class MysqliDb */ public function getOne($tableName, $columns = '*') { + if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { + $tableName = DATABASE_PREFIX . $tableName; + } + $res = $this->get($tableName, 1, $columns); if ($res instanceof MysqliDb) { @@ -786,6 +790,12 @@ class MysqliDb */ public function getValue($tableName, $column, $limit = 1) { + error_log('1 '.$tableName); + if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { + $tableName = DATABASE_PREFIX . $tableName; + } + error_log('2 '.$tableName); + $res = $this->ArrayBuilder()->get($tableName, $limit, "{$column} AS retval"); if (!$res) { @@ -832,6 +842,9 @@ class MysqliDb */ public function insertMulti($tableName, array $multiInsertData, array $dataKeys = null) { + if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { + $tableName = DATABASE_PREFIX . $tableName; + } // only auto-commit our inserts, if no transaction is currently running $autoCommit = (isset($this->_transaction_in_progress) ? !$this->_transaction_in_progress : true); $ids = array(); From f0d43fd18b649832408146b54ae2d72ea9525735 Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Sat, 24 Sep 2022 00:05:50 -0500 Subject: [PATCH 10/11] remove error_log debugging --- qrcode/lib/MysqliDb/MysqliDb.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/qrcode/lib/MysqliDb/MysqliDb.php b/qrcode/lib/MysqliDb/MysqliDb.php index b01e8c6..e7b0e5c 100644 --- a/qrcode/lib/MysqliDb/MysqliDb.php +++ b/qrcode/lib/MysqliDb/MysqliDb.php @@ -790,11 +790,9 @@ class MysqliDb */ public function getValue($tableName, $column, $limit = 1) { - error_log('1 '.$tableName); if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { $tableName = DATABASE_PREFIX . $tableName; } - error_log('2 '.$tableName); $res = $this->ArrayBuilder()->get($tableName, $limit, "{$column} AS retval"); From 9799509ff643db61ae672ffb97e47658715f11dd Mon Sep 17 00:00:00 2001 From: 0xRenegade Date: Sat, 24 Sep 2022 00:24:03 -0500 Subject: [PATCH 11/11] set static attribute of class rather than non-DRY code --- qrcode/lib/MysqliDb/MysqliDb.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/qrcode/lib/MysqliDb/MysqliDb.php b/qrcode/lib/MysqliDb/MysqliDb.php index e7b0e5c..419179a 100644 --- a/qrcode/lib/MysqliDb/MysqliDb.php +++ b/qrcode/lib/MysqliDb/MysqliDb.php @@ -28,7 +28,7 @@ class MysqliDb * * @var string */ - public static $prefix = ''; + public static $prefix = DATABASE_PREFIX; /** * MySQLi instances @@ -727,7 +727,7 @@ class MysqliDb $column = is_array($columns) ? implode(', ', $columns) : $columns; - if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { + if (strpos($tableName, '.') === false) { $this->_tableName = self::$prefix . $tableName; } else { $this->_tableName = $tableName; @@ -761,10 +761,6 @@ class MysqliDb */ public function getOne($tableName, $columns = '*') { - if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { - $tableName = DATABASE_PREFIX . $tableName; - } - $res = $this->get($tableName, 1, $columns); if ($res instanceof MysqliDb) { @@ -790,10 +786,6 @@ class MysqliDb */ public function getValue($tableName, $column, $limit = 1) { - if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { - $tableName = DATABASE_PREFIX . $tableName; - } - $res = $this->ArrayBuilder()->get($tableName, $limit, "{$column} AS retval"); if (!$res) { @@ -840,9 +832,6 @@ class MysqliDb */ public function insertMulti($tableName, array $multiInsertData, array $dataKeys = null) { - if (strpos($tableName, '.') === false && strpos($tableName, DATABASE_PREFIX) === false) { - $tableName = DATABASE_PREFIX . $tableName; - } // only auto-commit our inserts, if no transaction is currently running $autoCommit = (isset($this->_transaction_in_progress) ? !$this->_transaction_in_progress : true); $ids = array();