Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From your comment:</p> <pre><code>["product_id"]=&gt; string(5) "Array" </code></pre> <p>This means that <code>$_POST['product_id']</code> is a string that contains the word <code>Array</code>. This cannot happen with the code you've posted. My guess is that you are filling a form field called <code>product_id</code> using a complete PHP array, rather than one of its items. E.g.:</p> <pre><code>$foo = array(1, 2, 3); echo '&lt;input type="hidden" name="product_id" value="' . $foo . '"&gt;'; </code></pre> <p>... which prints:</p> <pre><code>&lt;input type="hidden" name="product_id" value="Array"&gt; </code></pre> <p><strong>Update:</strong></p> <p>I'm not sure you fully got my point. Here's a full snippet that reproduces your problem:</p> <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt;&lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;?php echo '&lt;xmp&gt;'; var_dump($_POST); echo '&lt;/xmp&gt;'; ?&gt; &lt;form action="" method="post"&gt; &lt;div&gt; &lt;input type="hidden" name="product_id[]" value="1"&gt; &lt;input type="hidden" name="product_id[]" value="2"&gt; &lt;?php $foo = array(1, 2, 3); echo '&lt;input type="hidden" name="product_id" value="' . $foo . '"&gt;'; ?&gt; &lt;/div&gt; &lt;div&gt;&lt;input type="submit" name="Submit"&gt;&lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>As I said, the sole code you've shown us cannot have this effect. That's why seeing the full code is so important.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload