Hi
I'm trying to get reviewerid, firstname and last name through a drop down selection box in my html form. The code below is line 26-38 from the attachment. Currentl, it echoes to the browser much of what you see here, rather than pulling the data and displaying it in a drop down. I'd appreciate any advice.

<?php
require ("dbcnx.php");

  $get_type=mysql_query("SELECT reviewerid, firstname, lastname FROM reviewer");
  /* create form containing selection list */

        echo "<select name='reviewerid'>\n";

  while ($row3 = mysql_fetch_array($get_type))
  {
     extract($row3);
     echo "<option value='$reviewerid'> $reviewerid $firstname $lastname \n</option>";

  }
  echo "</select>\n";
  ?>

Your file ends with .html, try changing it to .php to get the php interpreter to parse it.

Member Avatar for diafol

Just a note - you're using deprecated code - maybe better to use mysqli / PDO. You could also use bind_result() / bindColumn() instead of extract(), but that's another story.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.