title: PHP not Echoing Values for Drop Down Correctly
body: <p>I am currently trying to create a ticketing system from scratch using PHP and MYSQL. I would like to have a drop down that allows you to assign tickets to a user based on the user list from MYSQL. Currently this is the code I have to populate the  with options:</p>
  
  <pre><code>$sqlq1 = "SELECT fname, lname FROM ticket_users";
  $query = mysql_query($sqlq1);
  $array = mysql_fetch_array($query);
  
  
  foreach($array as $row){
  echo '&lt;option value ='."$row[fname]".'&gt;'.$row[fname].$row[lname].'&lt;/option&gt;';
  }
  </code></pre>
  
  <p>The issues I'm having are three fold:</p>
  
  <ol>
  <li>The code only prints from the first row of the SQL</li>
  <li>The code does not cycle equal to the number of user records</li>
  <li>When the code does print the information from the first row it's only printing the first characters from each field and is multiplying them.</li>
  </ol>
  
  <p>The output looks like this:</p>
  
  <pre><code>&lt;h3&gt; Assign To: &lt;select name="assignee"&gt;
  &lt;option value =J&gt;JJ&lt;/option&gt;
  &lt;option value =J&gt;JJ&lt;/option&gt;
  &lt;option value =F&gt;FF&lt;/option&gt;
  &lt;option value =F&gt;FF&lt;/option&gt;
  
  &lt;/select&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>And this is what a print_r of the array looks like:</p>
  
  <pre><code>Array ( [0] =&gt; Jim [fname] =&gt; Jim [1] =&gt; Frail [lname] =&gt; Frail )
  </code></pre>
  
  <p>And Here's the var dump:</p>
  
  <pre><code>array(4) { [0]=&gt; string(3) "Jim" ["fname"]=&gt; string(3) "Jim" [1]=&gt; string(5) "Frail" ["lname"]=&gt; string(5) "Frail" }
  </code></pre>
  
  <p>I wasn't even sure how to search for a solution to this issue so hopefully my title will help some other people find the solution as well.</p>
  
  <p>Thanks in advance for the help.</p>
  
  <p>PS. After some looking in to it I have been able to determine that the J's all come from the first name of the first row and all the F's come from the last name of the first row. Hope this helps.</p>