Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]Error: A non-numeric value encountered
#1

(This post was last modified: 02-09-2021, 01:40 AM by alakian.)

I have this code:

PHP Code:
    public function pricesListByAjax()
    {
        if(
$this->request->isAJAX()){
            
$html ''// Line 395
            
$html += '<div>';
            
$html += '<div class=""></div>';
            
$html += '</div>';
            return 
$html;
        }
    } 

But in action I see this error:

PHP Code:
    "title""ErrorException",
    "type""ErrorException",
    "code"500,
    "message""A non-numeric value encountered",
    "file""C:\\MAMP\\htdocs\\ci4\\app\\Controllers\\ProductController.php",
    "line"395


how do can I fix this error?
Reply
#2

See Line 395 in C:\\MAMP\\htdocs\\ci4\\app\\Controllers\\ProductController.php.
Reply
#3

(02-09-2021, 01:34 AM)kenjis Wrote: See Line 395 in C:\\MAMP\\htdocs\\ci4\\app\\Controllers\\ProductController.php.

Line 395:

Code:
$html = ''; // Line 395
Reply
#4

Not `$html += '<div>';`
But `$html .= '<div>';`
Reply
#5

(02-09-2021, 01:38 AM)kenjis Wrote: Not `$html += '<div>';`
But `$html .= '<div>';`


Thanks Fix it.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB