title: How can I assign a variable's value to another variable which comes before?
body: <p>My code is here :</p>
  
  <pre><code>$array_letter = array("A","B","C","Ç","D","E","F","G","H","I","İ","J","K","L",
                        "M","N","O","P","R","S","Ş","T","U","Ü","V","Y","Z");
  
  $sql = "SELECT id,city  FROM city WHERE city LIKE '" .$array_letter[$i]."%'";
  </code></pre>
  
  <p>And after these codes :</p>
  
  <pre><code>for ($i=0;$i&lt;27;$i++) {
  $result = mysql_query($sql);
  while ($row = mysql_fetch_array($result)) {
  
   echo "&lt;h3&gt;".$row['city']."&lt;/h3&gt;";
  
     }    
  }
  </code></pre>
  
  <p>$sql is meaningless because <code>$array_letter[$i]</code>will not work there. But $sql must be top of these codes for design. Because I coded <code>switch-case statement</code>. According to requests, <code>$sql</code> will change for this reason I can not write <code>$sql</code> under for loops. But all my queries depens on <code>$array_letter</code>. How can I make <code>$array_letter</code> work?</p>