Guest User

Untitled

a guest
May 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. function createSelectPCI($pci) {
  2. $i = 1;
  3. $query = sprintf("SELECT * FROM components WHERE componenttype = 'pci'");
  4. $resultid = mysql_query($query);
  5. if(mysql_num_rows($resultid) != 0) {
  6. print "<ul>";
  7. while($i <= $pci) {
  8. printf("<li><label for=\"pci%d\">PCI Expansion Slot %d</label><select name=\"pci%d\">\n", $i, $i, $i);
  9. getPCIOptions($resultid);
  10. print "</select>\n</li>\n";
  11. $i++;
  12. }
  13. print "</ul>\n";
  14. }
  15. }
  16.  
  17. function getPCIOptions($resultid) {
  18. if($resultid) {
  19. print "<option value=\"0\">&hellip;Please choose</option>\n";
  20. while($row = mysql_fetch_array($resultid)) {
  21. printf("<option value=\"%s\">%s</option>\n", $row["componentid"], $row["componentname"]);
  22. }
  23. }
  24. else print mysql_error();
  25. }
Add Comment
Please, Sign In to add comment