Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createSelectPCI($pci) {
- $i = 1;
- $query = sprintf("SELECT * FROM components WHERE componenttype = 'pci'");
- $resultid = mysql_query($query);
- if(mysql_num_rows($resultid) != 0) {
- print "<ul>";
- while($i <= $pci) {
- printf("<li><label for=\"pci%d\">PCI Expansion Slot %d</label><select name=\"pci%d\">\n", $i, $i, $i);
- getPCIOptions($resultid);
- print "</select>\n</li>\n";
- $i++;
- }
- print "</ul>\n";
- }
- }
- function getPCIOptions($resultid) {
- if($resultid) {
- print "<option value=\"0\">…Please choose</option>\n";
- while($row = mysql_fetch_array($resultid)) {
- printf("<option value=\"%s\">%s</option>\n", $row["componentid"], $row["componentname"]);
- }
- }
- else print mysql_error();
- }
Add Comment
Please, Sign In to add comment