Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6606f30ceb | ||
|
|
e1255e0872 | ||
|
|
5c53621f96 |
@@ -158,6 +158,11 @@
|
|||||||
print $basic->magic_links('user@bubu.at').'<br>';
|
print $basic->magic_links('user@bubu.at').'<br>';
|
||||||
print $basic->magic_links('http://test.com/foo/bar.php?foo=1').'<br>';
|
print $basic->magic_links('http://test.com/foo/bar.php?foo=1').'<br>';
|
||||||
|
|
||||||
|
// compare date
|
||||||
|
$date_1 = '2017/1/5';
|
||||||
|
$date_2 = '2017-01-05';
|
||||||
|
print "COMPARE DATE: ".$basic->CompareDate($date_1, $date_2)."<br>";
|
||||||
|
|
||||||
// print error messages
|
// print error messages
|
||||||
print $basic->print_error_msg();
|
print $basic->print_error_msg();
|
||||||
|
|
||||||
|
|||||||
@@ -1239,8 +1239,8 @@
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
// splits the data up with / or -
|
// splits the data up with / or -
|
||||||
list ($start_year, $start_month, $start_day) = split('[/-]', $start_date);
|
list ($start_year, $start_month, $start_day) = preg_split('/[\/-]/', $start_date);
|
||||||
list ($end_year, $end_month, $end_day) = split('[/-]', $end_date);
|
list ($end_year, $end_month, $end_day) = preg_split('/[\/-]/', $end_date);
|
||||||
// check that month & day are two digits and then combine
|
// check that month & day are two digits and then combine
|
||||||
foreach (array('start', 'end') as $prefix)
|
foreach (array('start', 'end') as $prefix)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1390,6 +1390,8 @@
|
|||||||
{
|
{
|
||||||
// if this is an insert query, check if we can add a return
|
// if this is an insert query, check if we can add a return
|
||||||
if ($this->_check_query_for_insert($query, true))
|
if ($this->_check_query_for_insert($query, true))
|
||||||
|
{
|
||||||
|
if ($pk_name != 'NULL')
|
||||||
{
|
{
|
||||||
// set primary key name
|
// set primary key name
|
||||||
// current: only via parameter
|
// current: only via parameter
|
||||||
@@ -1421,6 +1423,11 @@
|
|||||||
$this->prepare_cursor[$stm_name]['returning_id'] = true;
|
$this->prepare_cursor[$stm_name]['returning_id'] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->prepare_cursor[$stm_name]['pk_name'] = $pk_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
// search for $1, $2, in the query and push it into the control array
|
// search for $1, $2, in the query and push it into the control array
|
||||||
preg_match_all('/(\$[0-9]{1,})/', $query, $match);
|
preg_match_all('/(\$[0-9]{1,})/', $query, $match);
|
||||||
$this->prepare_cursor[$stm_name]['count'] = count($match[1]);
|
$this->prepare_cursor[$stm_name]['count'] = count($match[1]);
|
||||||
@@ -1484,7 +1491,7 @@ $this->debug('ExecuteData', 'ERROR in STM['.$stm_name.'|'.$this->prepare_cursor[
|
|||||||
$this->_db_error($this->prepare_cursor[$stm_name]['result']);
|
$this->_db_error($this->prepare_cursor[$stm_name]['result']);
|
||||||
$this->_db_debug('db', '<span style="color: red;"><b>DB-Error</b> '.$stm_name.': Execution failed</span>', 'DB_ERROR');
|
$this->_db_debug('db', '<span style="color: red;"><b>DB-Error</b> '.$stm_name.': Execution failed</span>', 'DB_ERROR');
|
||||||
}
|
}
|
||||||
if ($this->_check_query_for_insert($this->prepare_cursor[$stm_name]['query'], true))
|
if ($this->_check_query_for_insert($this->prepare_cursor[$stm_name]['query'], true) && $this->prepare_cursor[$stm_name]['pk_name'] != 'NULL')
|
||||||
{
|
{
|
||||||
if (!$this->prepare_cursor[$stm_name]['returning_id'])
|
if (!$this->prepare_cursor[$stm_name]['returning_id'])
|
||||||
{
|
{
|
||||||
@@ -1493,6 +1500,7 @@ $this->debug('ExecuteData', 'ERROR in STM['.$stm_name.'|'.$this->prepare_cursor[
|
|||||||
elseif ($code)
|
elseif ($code)
|
||||||
{
|
{
|
||||||
$this->insert_id = array ();
|
$this->insert_id = array ();
|
||||||
|
$this->insert_id_ext = array ();
|
||||||
// we have returning, now we need to check if we get one or many returned
|
// we have returning, now we need to check if we get one or many returned
|
||||||
// we'll need to loop this, if we have multiple insert_id returns
|
// we'll need to loop this, if we have multiple insert_id returns
|
||||||
while ($_insert_id = $this->db_functions->_db_fetch_array($code, PGSQL_ASSOC))
|
while ($_insert_id = $this->db_functions->_db_fetch_array($code, PGSQL_ASSOC))
|
||||||
|
|||||||
Reference in New Issue
Block a user