title: PHP/MYSQL array storing and retrieval issue
body: <p>I want to store short arrays in a field.  (I realize there are reasons to break the array up into items and store separately, but I'm opting for a simple storage option at the expense of less capability.)</p>
  
  <p>My code to create the array is as follows:</p>
  
  <pre><code>$str = "one,two,three,four";
  $array = explode (",",$str)
  </code></pre>
  
  <p>I then store into a text field in mysql using an insert statement  It seems to store fine.  In PhPAdmin, it shows ARRAY in the field and if I just echo $array, it prints "ARRAY".</p>
  
  <p>The problem is occurring when I try to retrieve data.  </p>
  
  <p>I am retrieving using </p>
  
  <pre><code>while($row = mysql_fetch_array($res)) { 
  $array = $row['list']; //that's the field it is stored in 
  echo $array; // echoes "ARRAY"
  </code></pre>
  
  <p>//so far so good.  However, when I then try to print out the contents of the array, I get error messages.  I have tried using implode and also for each.  </p>
  
  <pre><code>$text = implode(",", $array);//yields error message improper argument in implode function
  foreach($array as $val) {
      echo $val;
  } //yields error message improper argument for for each statement
  
  }
  </code></pre>
  
  <p>Could my entry in the dbase not be a proper array?  What could the problem be?  Thanks for any suggestions.</p>