Fix, config master base style/js, fix DB\IO num rows
DB\IO dbReturn also sets internal num_rows, num_fields, field_names so the normal dbGet* calls can be used after dbReturn call JAVASCRIPT/STYLESHEET in config.master is now override able from .env file. Others will follow
This commit is contained in:
@@ -69,6 +69,9 @@ $db->dbSetEncoding('SJIS');
|
||||
print "ENCODING TEST: " . $db->dbVersionInfo('client_encoding') . "/" . $db->dbGetEncoding() . "<br>";
|
||||
$db->dbResetEncoding();
|
||||
|
||||
$res = $db->dbReturn("SELECT * FROM max_test");
|
||||
print "DB RETURN ROWS: " . $db->dbGetNumRows() . "<br>";
|
||||
|
||||
while (is_array($res = $db->dbReturn("SELECT * FROM max_test", DbIo::USE_CACHE, true))) {
|
||||
print "UUD/TIME: " . $res['uid'] . "/" . $res['time'] . "<br>";
|
||||
}
|
||||
@@ -277,7 +280,7 @@ print "Wrote to DB tabel $table with data " . print_r($data, true) . " and got p
|
||||
// return Array Test
|
||||
$query = "SELECT type, sdate, integer FROM foobar";
|
||||
$data = $db->dbReturnArray($query, true);
|
||||
print "Full foobar list: <br><pre>" . print_r($data, true) . "</pre><br>";
|
||||
print "Rows: " . $db->dbGetNumRows() . ", Full foobar list: <br><pre>" . print_r($data, true) . "</pre><br>";
|
||||
|
||||
// trigger a warning
|
||||
print "<b>WARNING NEXT</b><br>";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "gullevek/corelibs",
|
||||
"description": "CoreLibs",
|
||||
"name": "gullevek/corelibs-dev",
|
||||
"version": "dev-master",
|
||||
"description": "CoreLibs: Development package",
|
||||
"type": "library",
|
||||
"authors": [
|
||||
{
|
||||
|
||||
@@ -274,8 +274,8 @@ define('G_TITLE', $_ENV['G_TITLE'] ?? '');
|
||||
/************ STYLE SHEETS / JS **********/
|
||||
define('ADMIN_STYLESHEET', 'edit.css');
|
||||
define('ADMIN_JAVASCRIPT', 'edit.js');
|
||||
define('STYLESHEET', 'frontend.css');
|
||||
define('JAVASCRIPT', 'frontend.js');
|
||||
define('STYLESHEET', $_ENV['STYLESHEET'] ?? 'frontend.css');
|
||||
define('JAVASCRIPT', $_ENV['JAVASCRIPT'] ?? 'frontend.js');
|
||||
|
||||
// anything optional
|
||||
/************* INTERNAL ******************/
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* AUTHOR: Clemens Schwaighofer
|
||||
* CREATED: 2008/08/01
|
||||
* SHORT DESCRIPTION:
|
||||
* URL redirect header
|
||||
* HISTORY:
|
||||
*********************************************************************/
|
||||
|
||||
|
||||
@@ -1786,9 +1786,12 @@ class IO
|
||||
// count the rows returned (if select)
|
||||
$this->cursor_ext[$query_hash]['num_rows'] =
|
||||
$this->db_functions->__dbNumRows($this->cursor_ext[$query_hash]['cursor']);
|
||||
// also set last return
|
||||
$this->num_rows = $this->cursor_ext[$query_hash]['num_rows'];
|
||||
// count the fields
|
||||
$this->cursor_ext[$query_hash]['num_fields'] =
|
||||
$this->db_functions->__dbNumFields($this->cursor_ext[$query_hash]['cursor']);
|
||||
$this->num_fields = $this->cursor_ext[$query_hash]['num_fields'];
|
||||
// set field names
|
||||
$this->cursor_ext[$query_hash]['field_names'] = [];
|
||||
for ($i = 0; $i < $this->cursor_ext[$query_hash]['num_fields']; $i++) {
|
||||
@@ -1798,6 +1801,7 @@ class IO
|
||||
$i
|
||||
);
|
||||
}
|
||||
$this->field_names = $this->cursor_ext[$query_hash]['field_names'];
|
||||
// reset first call vars
|
||||
$this->cursor_ext[$query_hash]['firstcall'] = 0;
|
||||
// reset the internal pos counter
|
||||
|
||||
Reference in New Issue
Block a user