Welcome Guest, Not a member yet? Register   Sign In
Call to undefined method mysqli_stmt::get_result()
#11

Glad it worked out! As it currently stands the maintainers of the framework don't want any application specific platforms mentioned (Cpanel, DirectAdmin etc) in the user guide. So I can't add hints about how e.g. Cpanel works.

mysqlnd are for some reason not the default value for Cpanel.
Reply
#12

Hi,

I continue to experience problems with prepared statements and I really do not know why. The following is returning

PHP Code:
public function addQuote($vals) {
        
print_r($vals);
        
$db db_connect();
        
$pQuery $db->prepare(function($db)
        {                    
            
$sql "INSERT INTO quotes (quote_status, division, quote_value, closing_date, client_name, client_site, work_desc, create_user) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
            return (new 
Query($db))->setQuery($sql);
        });
        
        try{
            
$pQuery->execute(
                
$vals['quote_status'],
                
$vals['division'],
                
$vals['quote_value'],
                
$vals['closing_date_db'],
                
$vals['client_name'],
                
$vals['client_site'],
                
$vals['work_desc'],
                
$vals['user_name']                
            );
            return 
$db->insertID();
        }catch(\
Exception $e) {
            return 
false;
        }
    } 
The above is returning (below) but the record is written to the DB.

ErrorException

Trying to access array offset on value of type int

SYSTEMPATH/Database/Query.php at line 479

472        {
473            return $sql;
474        }
475
476        do
477        {
478            $c--;
479            $escapedValue = $binds[$c][1] ? $this->db->escape($binds[$c][0]) : $binds[$c][0];
480            if (is_array($escapedValue))
481            {
482                $escapedValue = '(' . implode(',', $escapedValue) . ')';
483            }
484            $sql = substr_replace($sql, $escapedValue, $matches[0][$c][1], $ml);
485        }
486        while ($c !== 0);

    Backtrace Server Request Response Files Memory


Response Status
500 - Internal Server Error
Headers
Header
ValueCache-control
no-store, max-age=0, no-cache
Content-Type
text/html; charset=UTF-8



[*]SYSTEMPATH/Database/Query.php : 479   —  CodeIgniter\Debug\Exceptions->errorHandler ( arguments )

Code:
472         {
473             return $sql;
474         }
475
476         do
477         {
478             $c--;
479             $escapedValue = $binds[$c][1] ? $this->db->escape($binds[$c][0]) : $binds[$c][0];
480             if (is_array($escapedValue))
481             {
482                 $escapedValue = '(' . implode(',', $escapedValue) . ')';
483             }
484             $sql = substr_replace($sql, $escapedValue, $matches[0][$c][1], $ml);
485         }
486         while ($c !== 0);
[*]SYSTEMPATH/Database/Query.php : 408   —  CodeIgniter\Database\Query->matchSimpleBinds ( arguments )

Code:
$sql
[*]INSERT INTO quotes (quote_status, division, quote_value, closing_date, client_name, client_site, work_desc, create_user) VALUES (?, ?, ?, ?, 'W', 'S', 'S', 'M')

Code:
$binds
[*]Array
(
    [0] => Not_Quoted
    [1] => Electrical
    [2] => 1,414.00
    [3] => 1595458800
    [4] => West One
    [5] => Strood
    [6] => Shop
    [7] => Martin Thorburn
)


Code:
$bindCount
[*]8

Code:
$ml
[*]

I would really appreciate some help here (php config is attached- if needed)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB