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.

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))
     echo "<option value='$reviewerid'> $reviewerid $firstname $lastname \n</option>";

  echo "</select>\n";

Recommended Answers

All 2 Replies

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

Member Avatar

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, learning, and sharing knowledge.