Exception error with message cannot use object of type stdclass as array

How many times have you fallen upon the dreaded “cannot use object of type stdClass as array” error message? In this tutorial, you will learn how to solve the error […]

How many times have you fallen upon the dreaded “cannot use object of type stdClass as array” error message? In this tutorial, you will learn how to solve the error and it’s much easier than you think.

The PHP engine throws the “cannot use object of type stdClass as array” error message due to your code trying to access a variable that is an object type as an array. It is most likely that you’ve tried to access the data with the generic bracket array accessor and not an object operator. Always ensure that you know the variable type before you try to access the data.

See the following example which will throw this error.

Example code 1 (Throws error)

This example shows an object being accessed with an array style syntax which, throws an error of “cannot use object of type stdClass as array”

PHP

$object = new stdClass();
$object->myFirstProperty = 'My First Value';
$object->mySecondProperty = 'My Second Value';
$object->myThirdProperty = 'My Third Value';
$object->myFourthProperty = 'My Fourth Value';


echo $object["myFirstProperty"]; // Error thrown here

And the second example that won’t throw an error.

Example code 2 (Doesn’t throw an error)

Using the same code whilst using the object operator to access the values will not throw the error.

PHP

$object = new stdClass();
$object->myFirstProperty = 'My First Value';
$object->mySecondProperty = 'My Second Value';
$object->myThirdProperty = 'My Third Value';
$object->myFourthProperty = 'My Fourth Value';


//echo $object["myFirstProperty"];

echo $object->myFirstProperty;

Output

My First Value

So how do we get around the error

There are two choices to solve the issue of this error.

  1. Access the values with an object operator as demonstrated in Code Example 2.
  2. Convert the object to an array before accessing it with array style syntax (Example below)

Example code 3 (Doesn’t throw an error)

$object = new stdClass();
$object->myFirstProperty = 'My First Value';
$object->mySecondProperty = 'My Second Value';
$object->myThirdProperty = 'My Third Value';
$object->myFourthProperty = 'My Fourth Value';

$array = json_decode(json_encode($object), true);


echo $array["myFirstProperty"];

Output

My First Value

Summary

And that is all there is to it, it is simple, yes, but you can be caught out when using the various frameworks such as Laravel. Laravel returns database data via the eloquent library it uses as an object by default and so it must be converted to an array to prevent the error from being thrown. Check out an article I wrote previously on converting an object to an array in PHP.

The given snippet is dedicated to a common PHP issue «cannot use object of Type stdClass as an array».

Read on to learn how to fix this issue accurately.

The function that we recommend you to use is json_decode.

This function is capable of returning an object by default.

Data may be accessed in the following way:

var_dump($result->context);

In the event of having identifiers such as, you should implement:

var_dump($result->{'from-date'});

In case you intend to have an array, then run the code below:

$result = json_decode($json, true);

Alternatively, you can cast the object to an array like so:

$result = (array) json_decode($json);

Let’s consider another solution with the -> sign.

So, access with the help of -> as it is an object.

Then, change the code from:

To:

There you are.

This is considered an empty class in PHP. It is applied for casting other types to the object. The stdClass has similarities with Python or Java objects.

You should take into consideration that stdClass is not the base class. Once an object is converted to an object, it is not changed. Yet, once an object type is converted to an instance of the stdClass generated, it is not NULL. Once it is NULL, the new instance will be empty.

The main use cases of the stdClass in PHP are:

  • It directly accesses the members by calling them.
  • It is handy for dynamic objects.
  • It is used for setting dynamic properties, and so on.

The json_decode function is used for taking a JSON encoded string and converting it into a PHP variable.

It has four parameters: json, assoc, depth, and options.

Once the assoc parameter is TRUE, then the returned objects will be converted to associative arrays.

Suddenly, one day you get into trouble with the fatal error “Cannot use object of type stdclass as array”. And you are also looking for a useful solution to handle this problem. Luckily, in this blog, we are going to explain and fix this common error that every programmer face. Before going over the solutions, you need to understand why this error arises.

Why did you hit the error “cannot use object of type stdclass as array”?

The error “cannot use object of type stdclass as array’ occurs. Because once you utilize
json_decode();
function, it returns an object of type stdClass. Whereas, the arguments which are to be passed inside of
print_r()
should either be a string or an array. Therefore, once you pass an object inside of
print_r()
, then this error will come in PHP.

Now, let’s refer to the following solution to handle this problem.

Cannot Use Object Of Type Stdclass As Array

How to tackle fatal error “Cannot use object of type stdClass as array” in php

Here are the two solutions that can help you resolve your issue:

Method 1: Cast the object to an array

Now, you need to cast the object to an array as below:


$a = (array)$object;

Method 2: By accessing the key of the Object

As we revealed above, once you utilize
json_decode();
function, you will get an Object of stdClass as return type. So, you are able to access the elements of the object thanks to the assistance of
->
Operator.

You need to implement as follows:


$value = $object->key;

In case the object has plenty of nested arrays, you can also utilize different keys to extract the sub-elements. For example:


$value = $object->key1->key2->key3...;

Alternatively, you also set the change the second parameter of the
json_decode();
to true, then the object will be automatically converted to an
array();
.

Also, If you set the second parameter of the json_decode(); to true, it will automatically convert the object to an
array();
.

Wrap up

Has your error been resolved? If yes, let us know the solution that is useful for your error by leaving a comment below. In case, your error is not disappearing, don’t hesitate to share with us your situation. We are always willing to support you.

Last but not least, our website specializes in providing plenty of stunning, SEO-friendly free WordPress themes. You can visit and get one to make your site more appealing. Thanks for your reading.

  • Author
  • Recent Posts

Lt Digital Team (Content &Amp; Marketing)

Welcome to LT Digital Team, we’re small team with 5 digital content marketers. We make daily blogs for Joomla! and WordPress CMS, support customers and everyone who has issues with these CMSs and solve any issues with blog instruction posts, trusted by over 1.5 million readers worldwide.

Lt Digital Team (Content &Amp; Marketing)

$tr = Array ( [0] => stdClass Object ( [account] => 265388630323288 [category] => move [time] => 1423668673 [amount] => -0.00455848 [otheraccount] => 2309 [comment] => ) [1] => stdClass Object ( [account] =>  265388630323288 [category] => move [time] => 1423668673 [amount] => -0.00455848 [otheraccount] => 2309 [comment] => )  )

Выполняю

<?php foreach($tr as $t) : ?>

 <?php switch( $t['category'] ) {

...............

Выдает ошибку PHP Fatal error: Cannot use object of type stdClass as array in

Если делаю так
$items = json_decode($tr , true); или $items = json_decode($tr);

Получаю json_decode() expects parameter 1 to be string, array given in


  • Вопрос задан

    более трёх лет назад

  • 40326 просмотров

Потому что $t — это объект, и вместо $t['category'] нужно использовать $t->category

Это же элементарщина, да и ошибка предельно ясно говорит в чем проблема.

Пригласить эксперта

Если вы делаете так:
$items = json_decode($tr , true);

то ваш код должен корректно работать, так как второй аргумент функции json_decode, как раз и отвечает за, то что переданный json будет преобразован в ассоциативный массив, а не в объект.

$items = json_decode(json_encode($items),true);
и проблема решится.
оставлю тут для будущих искателей решения такого недоразумения.


  • Показать ещё
    Загружается…

09 февр. 2023, в 18:25

5000 руб./за проект

09 февр. 2023, в 18:23

2500 руб./за проект

09 февр. 2023, в 17:54

1000 руб./за проект

Минуточку внимания

PROBLEM :

We get a strange error using json_decode(). It decode correctly the data, but when we try to access info inside the array we get the following:

[pastacode lang=”php” manual=”Fatal%20error%3A%20Cannot%20use%20object%20of%20type%20stdClass%20as%20array%20in%0AC%3A%5CUsers%5CWiki%5Csoftware%5Cwikitechy.php%20on%20line%20108%0A” message=”Php Code” highlight=”” provider=”manual”/]

We tried to do: $result[‘context’] where $result has the data returned by json_decode()

php json

SOLUTION 1:

The function json_decode() returns an object by default.

Access the data :

[pastacode lang=”php” manual=”var_dump(%24result-%3Econtext)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

If we have identifiers like from-date (the hyphen would cause a PHP error when using the above method) we have to write the following:

[pastacode lang=”php” manual=”var_dump(%24result-%3E%7B’from-date’%7D)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

  • If we have identifiers like from-date (the hyphen would cause a PHP error when using the above method) we have to write the following:

[pastacode lang=”php” manual=”var_dump(%24result-%3E%7B’from-date’%7D)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

  • If we need an array we can do the following:

[pastacode lang=”php” manual=”%24result%20%3D%20json_decode(%24json%2C%20true)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

  • Or cast the object to an array:

[pastacode lang=”php” manual=”%24result%20%3D%20(array)%20json_decode(%24json)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

SOLUTION 2:

  • Use the second parameter of json_decode to make it return an array:

[pastacode lang=”php” manual=”%24result%20%3D%20json_decode(%24data%2C%20true)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

SOLUTION 3:

  • Use true as the second parameter to json_decode.
  • This will decode the json into an associative array instead of stdObject instances:

[pastacode lang=”php” manual=”%24my_array%20%3D%20json_decode(%24my_json%2C%20true)%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

SOLUTION 4:

  • If we call json_decode($somestring) we will get an Object and we need to access like $object->key,
  • But if we call json_decode($somestring, true) we will get an array and can access like $array[‘key’]

SOLUTION 5:

We can convert stdClass object to array :

[pastacode lang=”php” manual=”%24array%20%3D%20(array)%24stdClass%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

SOLUTION 6:

function:

[pastacode lang=”php” manual=”mixed%20json_decode%20(%20string%20%24json%20%5B%2C%20bool%20%24assoc%20%3D%20false%20%5B%2C%20int%20%24depth%20%3D%20512%20%5B%2C%20int%20%24options%20%3D%200%20%5D%5D%5D%20)%0A” message=”Php Code” highlight=”” provider=”manual”/]

  • When param is false, which is default, it will return an appropriate php type.
  • When param is true, it will return associative arrays.
  • It will return NULL on error.
  • If we want to fetch value through array, set assoc to true.

SOLUTION 7:

we must access it using -> since its an object.

Change our code from:

[pastacode lang=”php” manual=”%24result%5B’context’%5D%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

To:

[pastacode lang=”php” manual=”%24result-%3Econtext%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

SOLUTION 8:

  • print_r — Prints human-readable information about a variable
  • When we use json_decode();, we get an object of type stdClass as return type.
  • The arguments, which are to be passed inside of print_r() should either be an array or a string. Hence, we cannot pass an object inside of print_r(). There are two ways to deal with this.

1. Cast the object to array.
This can be achieved as follows.

[pastacode lang=”php” manual=”%24a%20%3D%20(array)%24object%3B%0A” message=”php Code” highlight=”” provider=”manual”/]

2. By accessing the key of the Object
when we use json_decode(); function, it returns an Object of stdClass. we can access the elements of the object with the help of -> Operator.

[pastacode lang=”php” manual=”%24value%20%3D%20%24object-%3Ekey%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

  • Use multiple keys to extract the sub elements incase if the object has nested arrays.

[pastacode lang=”php” manual=”%24value%20%3D%20%24object-%3Ekey1-%3Ekey2-%3Ekey3…%3B%0A” message=”Php Code” highlight=”” provider=”manual”/]

Their are many options to print_r() like var_dump(); and var_export();

Wikitechy Founder, Author, International Speaker, and Job Consultant. My role as the CEO of Wikitechy, I help businesses build their next generation digital platforms and help with their product innovation and growth strategy. I’m a frequent speaker at tech conferences and events.

Related Tags
  • Cannot use object of type stdClass as array,
  • Cannot use object of type stdClass as array – JSON,
  • Cannot use object of type stdClass as array in,
  • Cannot use object of type stdClass as array magento,
  • Cannot use object of type stdClass as array(php),
  • JSON Decode Fatal error: Cannot use object of type stdClass as array in,
  • json_decode to array,
  • php,
  • php — Cannot use object of type stdClass as array,
  • What is the correct JSON content type?

In this article, the error as specified in the title of this article will be discussed further using the case or the example extracted from a web page application powered by a Laravel framework. The Laravel Error Message specified is ‘Cannot use object of type stdClass as array‘. This error itself has something to do and it correlates with another article titled ‘Laravel Error Message Call to undefined method stdClass::toArray()‘ in this link.

This is the error which is shown in the form of an image :

Basically, there is a variable which is passed from the controller named RoleController.php to a blade view template file named ‘edit.blade.php’. Below is the snippet code which is indicating the passing process of a variable to the view file template in the RoleController.php file :

public function edit($id_role) {

        $edited_role = DB::table('role')->where('id_role',
         '=', $id_role)->first();

        return view('role.edit')->with('edited_role', $edited_role);
    }

As shown in the above snippet code, there is a variable named $edited_role is passed through the controller to a blade view template file named ‘edit.blade.php’ inside a folder named ‘role’ which is located in the view folder in the laravel framework which is usually stored in the ‘resources/views’. Below is the directory tree which is describing the location of the ‘edit.blade.php’ file using the ‘tree’ command in Linux operating system :

user@hostname:/var/www/html/laravel-project$ tree resources/
resources/
...
└── views
    ├── role
    │   ├── edit.blade.php
    │   └── index.blade.php
...

In this case, the error itself is actually happened in the blade view template file as shown in the following snippet code :

<div class="form-group">

<label class="col-md-3 form-label text-right" for="nameField">Name : </label>
<div class="col-md-6"><input class="form-control" name="name" type="text" value="{{ $edited_role['name'] }}" placeholder="Name" /></div>
&nbsp;

</div>

As it can be seen in the above snippet code, to be able to extract or to print the value of the ‘role’ name which is going to be edited further in the edit form, the code which is used is ‘{{ $edited_role[‘name’] }}’. It is a standard code for printing the value possessed by an associative key named ‘name’ inside the variable named ‘$edited_role’. That is when the error is finally triggered.

The error is ‘Cannot use object of type stdClass as array’. Based on the error itself, it can be fathomed and it is true that the variable which is passed in the form of class object named ‘edited_role’ from the controller file named ‘RoleController.php’ is printed in the way of an associative array should be printed. In other words, there is no way the object of the class retrieved from the query process executed from a table will be treated as an array.

To solve the problem and correct the error, the following part of the snippet code must be changed :

<div class="col-md-6"><input class="form-control" name="name" type="text" value="{{ $edited_role->name }}" placeholder="Name" /></div>

So, in order to be able to summon or to call the value of a certain field or attribute from a standard object model variable is by writing in this way ‘{{ $edited_role->name }}’.

  1. Home

  2. php — Cannot use object of type stdClass as array?

134 votes

16 answers

Get the solution ↓↓↓

I get a strange error usingjson_decode(). It decode correctly the data (I saw it usingprint_r), but when I try to access to info inside the array I get:

Fatal error: Cannot use object of type stdClass as array in
C:UsersDailsoftwareabs.php on line 108

I only tried to do:$result['context'] where$result has the data returned byjson_decode()

How can I read values inside this array?

2021-12-24

Write your answer


517

votes


806

votes


229

votes

Answer

Solution:

You must access it using -> since its an object.

Change your code from:

$result['context'];

To:

$result->context;


859

votes

Answer

Solution:

Usetrue as the second parameter tojson_decode. This will decode the json into an associative array instead ofstdObject instances:

$my_array = json_decode($my_json, true);

See the documentation for more details.


618

votes

Answer

Solution:

Have same problem today, solved like this:

If you calljson_decode($somestring) you will get an Object and you need to access like$object->key , but if u calljson_decode($somestring, true) you will get an dictionary and can access like$array['key']


659

votes

Answer

Solution:

It’s not an array, it’s an object of type stdClass.

You can access it like this:

echo $oResult->context;

More info here: What is stdClass in PHP?


289

votes

Answer

Solution:

As the Php Manual say,

print_r — Prints human-readable information about a variable

When we usejson_decode();, we get an object of type stdClass as return type.
The arguments, which are to be passed inside ofprint_r() should either be an array or a string. Hence, we cannot pass an object inside ofprint_r(). I found 2 ways to deal with this.

  1. Cast the object to array.
    This can be achieved as follows.

    $a = (array)$object;
    
  2. By accessing the key of the Object
    As mentioned earlier, when you usejson_decode(); function, it returns an Object of stdClass. you can access the elements of the object with the help of-> Operator.

    $value = $object->key;
    

One, can also use multiple keys to extract the sub elements incase if the object has nested arrays.

$value = $object->key1->key2->key3...;

Their are other options toprint_r() as well, likevar_dump(); andvar_export();

P.S : Also, If you set the second parameter of thejson_decode(); totrue, it will automatically convert the object to anarray();
Here are some references:
http://php.net/manual/en/function.print-r.php
http://php.net/manual/en/function.var-dump.php
http://php.net/manual/en/function.var-export.php


83

votes

Answer

Solution:

To get an array as result from a json string you should set second param as boolean true.

$result = json_decode($json_string, true);
$context = $result['context'];

Otherwise $result will be an std object. but you can access values as object.

  $result = json_decode($json_string);
 $context = $result->context;


833

votes

Answer

Solution:

Try something like this one!

Instead of getting the context like:(this works for getting array index’s)

$result['context']

try (this work for getting objects)

$result->context

Other Example is: (if$result has multiple data values)

Array
(
    [0] => stdClass Object
        (
            [id] => 15
            [name] => 1 Pc Meal
            [context] => 5
            [restaurant_id] => 2
            [items] => 
            [details] => 1 Thigh (or 2 Drums) along with Taters
            [nutrition_fact] => {"":""}
            [servings] => menu
            [availability] => 1
            [has_discount] => {"menu":0}
            [price] => {"menu":"8.03"}
            [discounted_price] => {"menu":""}
            [thumbnail] => YPenWSkFZm2BrJT4637o.jpg
            [slug] => 1-pc-meal
            [created_at] => 1612290600
            [updated_at] => 1612463400
        )

)

Then try this:

foreach($result as $results)
{
      $results->context;
}


957

votes

Answer

Solution:

Sometimes when working with API you simply want to keep an object an object. To access the object that has nested objects you could do the following:

We will assume when you print_r the object you might see this:

print_r($response);

stdClass object
(
    [status] => success
    [message] => Some message from the data
    [0] => stdClass object
        (
            [first] => Robert
            [last] => Saylor
            [title] => Symfony Developer
        )
    [1] => stdClass object
        (
            [country] => USA
        )
)

To access the first part of the object:

print $response->{'status'};

And that would output «success»

Now let’s key the other parts:

$first = $response->{0}->{'first'};
print "First name: {$first}<br>";

The expected output would be «Robert» with a line break.

You can also re-assign part of the object to another object.

$contact = $response->{0};
print "First Name: " . $contact->{'first'} . "<br>";

The expected output would be «Robert» with a line break.

To access the next key «1» the process is the same.

print "Country: " . $response->{1}->{'country'} . "<br>";

The expected output would be «USA»

Hopefully this will help you understand objects and why we want to keep an object an object. You should not need to convert an object to an array to access its properties.


679

votes

Answer

Solution:

You can convert stdClass object to array like:

$array = (array)$stdClass;

stdClsss to array


759

votes

Answer

Solution:

When you try to access it as$result['context'], you treating it as an array, the error it’s telling you that you are actually dealing with an object, then you should access it as$result->context


658

votes

Answer

Solution:

Here is the function signature:

mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]] )

When param is false, which is default, it will return an appropriate php type. You fetch the value of that type using object.method paradigm.

When param is true, it will return associative arrays.

It will return NULL on error.

If you want to fetch value through array, set assoc to true.


954

votes

Answer

Solution:

I got this error out of the blue because my facebook login suddently stopped working (I had also changed hosts) and throwed this error. The fix is really easy

The issue was in this code

  $response = (new FacebookRequest(
    FacebookSession::newAppSession($this->appId, $this->appSecret),
    'GET',
    '/oauth/access_token',
    $params
  ))->execute()->getResponse(true);

  if (isset($response['access_token'])) {       <---- this line gave error
    return new FacebookSession($response['access_token']);
  }

Basically isset() function expect an array but instead it find an object. The simple solution is to convert PHP object to array using (array) quantifier. The following is the fixed code.

  $response = (array) (new FacebookRequest(
    FacebookSession::newAppSession($this->appId, $this->appSecret),
    'GET',
    '/oauth/access_token',
    $params
  ))->execute()->getResponse(true);

Note the use off array() quantifier in first line.


141

votes

Answer

Solution:

instead of using the brackets use the object operator for example my array based on database object is created like this in a class called DB:

class DB {
private static $_instance = null;
private $_pdo,
        $_query, 
        $_error = false,
        $_results,
        $_count = 0;



private function __construct() {
    try{
        $this->_pdo = new PDO('mysql:host=' . Config::get('mysql/host') .';dbname=' . Config::get('mysql/db') , Config::get('mysql/username') ,Config::get('mysql/password') );


    } catch(PDOException $e) {
        $this->_error = true;
        $newsMessage = 'Sorry.  Database is off line';
        $pagetitle = 'Teknikal Tim - Database Error';
        $pagedescription = 'Teknikal Tim Database Error page';
        include_once 'dbdown.html.php';
        exit;
    }
    $headerinc = 'header.html.php';
}

public static function getInstance() {
    if(!isset(self::$_instance)) {
        self::$_instance = new DB();
    }

    return self::$_instance;

}


    public function query($sql, $params = array()) {
    $this->_error = false;
    if($this->_query = $this->_pdo->prepare($sql)) {
    $x = 1;
        if(count($params)) {
        foreach($params as $param){
            $this->_query->bindValue($x, $param);
            $x++;
            }
        }
    }
    if($this->_query->execute()) {

        $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);
        $this->_count = $this->_query->rowCount();

    }

    else{
        $this->_error = true;
    }

    return $this;
}

public function action($action, $table, $where = array()) {
    if(count($where) ===3) {
        $operators = array('=', '>', '<', '>=', '<=');

        $field      = $where[0];
        $operator   = $where[1];
        $value      = $where[2];

        if(in_array($operator, $operators)) {
            $sql = "{$action} FROM {$table} WHERE {$field} = ?";

            if(!$this->query($sql, array($value))->error()) {
            return $this;
            }
        }

    }
    return false;
}

    public function get($table, $where) {
    return $this->action('SELECT *', $table, $where);

public function results() {
    return $this->_results;
}

public function first() {
    return $this->_results[0];
}

public function count() {
    return $this->_count;
}

}

to access the information I use this code on the controller script:

<?php
$pagetitle = 'Teknikal Tim - Service Call Reservation';
$pagedescription = 'Teknikal Tim Sevice Call Reservation Page';
require_once $_SERVER['DOCUMENT_ROOT'] .'/core/init.php';
$newsMessage = 'temp message';

$servicecallsdb = DB::getInstance()->get('tt_service_calls', array('UserID',
 '=','$_SESSION['UserID']));

if(!$servicecallsdb) {
// $servicecalls[] = array('ID'=>'','ServiceCallDescription'=>'No Service Calls');
} else {
$servicecalls = $servicecallsdb->results();
}
include 'servicecalls.html.php';



?>

then to display the information I check to see if servicecalls has been set and has a count greater than 0 remember it’s not an array I am referencing so I access the records with the object operator «->» like this:

<?php include $_SERVER['DOCUMENT_ROOT'] .'/includes/header.html.php';?>
<!--Main content-->
<div id="mainholder"> <!-- div so that page footer can have a minum height from the
  header -->
<h1><?php if(isset($pagetitle)) htmlout($pagetitle);?></h1>
<br>
<br>
<article>
    <h2></h2>
</article>
<?php
if (isset($servicecalls)) {
if (count ($servicecalls) > 0){
     foreach ($servicecalls as $servicecall) {
        echo '<a href="/servicecalls/?servicecall=' .$servicecall->ID .'">'
  .$servicecall->ServiceCallDescription .'</a>';
    }
}else echo 'No service Calls';

}

?>
<a href="/servicecalls/?new=true">Raise New Service Call</a>
</div> <!-- Main content end-->
<?php include $_SERVER['DOCUMENT_ROOT'] .'/includes/footer.html.php'; ?>


825

votes

Answer

Solution:

Change it for

$results->fetch_array()


Share solution ↓

Additional Information:

Date the issue was resolved:

2021-12-24

Link To Source

Link To Answer
People are also looking for solutions of the problem: the process class relies on proc_open, which is not available on your php installation.

Didn’t find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.


Similar questions

Find the answer in similar questions on our website.

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.


About the technologies asked in this question

PHP

PHP (from the English Hypertext Preprocessor — hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/

Symfony

Symfony compares favorably with other PHP frameworks in terms of reliability and maturity. This framework appeared a long time ago, in 2005, that is, it has existed much longer than most of the other tools we are considering. It is popular for its web standards compliance and PHP design patterns.
https://symfony.com/

MySQL

DBMS is a database management system. It is designed to change, search, add and delete information in the database. There are many DBMSs designed for similar purposes with different features. One of the most popular is MySQL.
It is a software tool designed to work with relational SQL databases. It is easy to learn even for site owners who are not professional programmers or administrators. MySQL DBMS also allows you to export and import data, which is convenient when moving large amounts of information.
https://www.mysql.com/

HTML

HTML (English «hyper text markup language» — hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
https://www.w3.org/html/



Welcome to programmierfrage.com

programmierfrage.com is a question and answer site for professional web developers, programming enthusiasts and website builders. Site created and operated by the community. Together with you, we create a free library of detailed answers to any question on programming, web development, website creation and website administration.

Get answers to specific questions

Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.

Help Others Solve Their Issues

Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.

Понравилась статья? Поделить с друзьями:
  • Exception error dota 2
  • Exception error 15 modbus
  • Exception erangeerror in module interfaceeditor asi at 00014c6b samp range check error
  • Exception erangeerror in module gfxhack asi at 00007e9c range check error
  • Exception efc create error in module