I have a problem with this code in that the second while loop only runs the first time through the code, and then also it makes it so that the $row['id'] does not get a value. Can you help me figure out where I went wrong with this?
$result = mysqli_query($con,"SELECT * FROM faq ORDER BY `order`");
$result2 = mysqli_query($con,"SELECT * FROM sections ORDER BY `order`");
while($row = mysqli_fetch_array($result))
  {
  echo  '<form action="../../includes/faqupdate.php" method="post" style="margin:40px;">';
  echo  '<input type="text" name="order" style="width:20px;text-align:center;" onclick="this.value=\'\';" onfocus="this.select()" onblur="this.value=!this.value?\'' . $row['order'] . '\':this.value;" value="' . $row['order'] . '">';
  echo  '<input type="text" name="heading" onclick="this.value=\'\';" onfocus="this.select()" onblur="this.value=!this.value?\'' . $row['heading'] . '\':this.value;" value="' . $row['heading'] . '">';
  echo  '<select name="section">';
  $section = $row['section'];
  while($row = mysqli_fetch_array($result2)) {
      $sectionname = $row['sectionname'];
      if ($sectionname == $section) {
        echo    '<option value="' . $sectionname . '" selected="selected">' . $sectionname . '</option>';
      } else {
            echo    '<option value="' . $sectionname . '">' . $sectionname . '</option>';
      }
  }
  echo      '</select>';
  echo      '<input type="text" name="id" style="width:20px;background-color:#CCC;text-align:center;" value="' . $row['id'] . '" readonly>';
  echo      '<textarea name="content" cols="98" rows="10">' . $row['content'] . '</textarea>';
  echo      '<input type="submit" name="submission" value="Update">';
  echo      '<input type="submit" name="submission" value="Delete">';
  echo  '</form>';
  }
