title: Can't access JSON object from MySQL fetch result, PHP
body: <p>Context, I am doing this PHP project that has function update a product data, 
  the situation is the product has an amount of data, after the update, I pack all the data as a JSON object and store into MySQL DB. the reason of packing everything into one JSON object and store as one MySQL row is: in this project, the different product has different attributes, so I think this would be a quick solution for a temporary storing data. </p>
  
  <p>Problem, when I fetch back certain JSON object from MySQL DB, I can not access JSON object, I used JSON decode, but it not works. </p>
  
  <p>here is how I created JSON object </p>
  
  <pre><code>$product_INFO = (object)array(
      "ean_number" =&gt; "$Static_eanNumber",
      "product_name" =&gt; "$productName",
      "product_brand" =&gt; "$Brand",
      "product_weight_gr" =&gt; "$weight_GR",
      "product_vatrate" =&gt; "$vat__Rate",
      "product_supplier" =&gt; "$SUPPLIER",
      "product_googleShoppingCategory" =&gt; "$GOOGLE_ShoppingCategory",
      "LIGHTSPEED_INFO" =&gt; $LIGHTSPEED_product_info_array
  );
  </code></pre>
  
  <p>and encode </p>
  
  <pre><code>  $Data_in_JSON = json_encode($product_INFO);
  </code></pre>
  
  <p>query </p>
  
  <pre><code>  $write_JSON_object = "INSERT INTO editing ( eannumber, json) VALUES ('$Static_eanNumber','$Data_in_JSON')";
  </code></pre>
  
  <p>in mysql database table, the column for JSON is 
  Name: json Type: LongText  Collation: utf8mb4_bin</p>
  
  <p>when I fetch from the database, I use this query </p>
  
  <pre><code>   $find = "SELECT json FROM editing WHERE eannumber = 10000007 ";
  </code></pre>
  
  <p>and </p>
  
  <pre><code>   if (($found-&gt;num_rows) == 1) {
  
      $mysqlJSON = mysqli_fetch_array($found)[0];
      echo "&lt;pre&gt;";
      print_r($mysqlJSON);
      echo "&lt;/pre&gt;";
  
  }
  </code></pre>
  
  <p>This is the result I see on an HTML page </p>
  
  <pre><code>  {"ean_number":"10000007",
    "product_name":"somevalue",
    "product_brand":"Leba",
    "product_weight_gr":"65000",
    "product_vatrate":"0.21",
    "product_supplier":"LebaBenelux",
    "product_googleShoppingCategory":"",
    "LIGHTSPEED_INFO":    [{"product_shop_id":68295980,"product_price":"2854.9533"..........
  </code></pre>
  
  <p>I tried to use JSON decode the MySQL fetch result but it not works, So I cannot access this result by their keys such as "ean_number", </p>
  
  <pre><code>   print_r(json_decode($mysqlJSON)-&gt;ean_number);
  </code></pre>
  
  <p>I cannot tell where did I made mistake, I create a JSON object in the wrong way? something wrong with MySQL or how I fetch data. </p>
  
  <p>Please help thanks!!!</p>