title: Fatal error: [] operator not supported for strings
body: <p>I'm getting information from database, saving it in array and echoing it in a form with loop structure and I'm having problems when I try to save the modified information to database.</p>
  <p>I'm getting this error:</p>
  <blockquote>
  <p>Fatal error: [] operator not supported for strings in....</p>
  </blockquote>
  <p>Code:</p>
  <pre class="lang-php prettyprint-override"><code>$namesql1 = &quot;SELECT name,date,text,date2 FROM table WHERE something= '$something'&quot;;
  $nameresult1 = mysql_query($namesql1);
  $countrows = mysql_num_rows($nameresult1);
  while ($row = mysql_fetch_array($nameresult1, MYSQL_ASSOC)) {
      $name[] = $row['name'];
      $date[] = $row['date'];
      $text[] = $row['text'];
      $date2[] = $row['date2 '];
  }
  
  /** SOME CODE HERE **/
  
      
  $wrotesql = &quot;UPDATE service_report SET  name ='$name' , $date = '$date',$text = '$text[$nro]', ser_date = '$date2[$nro]' WHERE something = '$something')&quot;;
  
  $wroteresult = mysql_query($wrotesql);
  </code></pre>
  <p>Could somebody please give me a hint what I'm doing wrong?</p>