0
if (!$conn)
  {exit("Connection Failed: " . $conn);}

   $sql_exp = "select * from dbo.PC inner join dbo.FA_PC on dbo.PC.PCID = dbo.FA_PC.PCID WHERE UserID is NOT NULL order by dbo.fa_pc.PCID"; 
   $sql_exp1= "select * from dbo.users inner join dbo.FA_PC on dbo.users.UserID = dbo.FA_PC.UserID order by dbo.fa_pc.PCID";
   $sql_exp2 = "SELECT * FROM dbo.FA_PC WHERE FA_TypeID is NOT NULL ORDER BY PCID"; 
   $rs = $conn->Execute($sql_exp);
    $rs1 = $conn->Execute($sql_exp1);
   $rs2 = $conn->Execute($sql_exp2);
   echo "<table border='1' cellpadding='1' cellspacing='0' id='rounded-corner'><tr><th>Desktop Number</th><th>Employee</th><th><p align=left>Fixed Asset Accountability</p></th></tr>";
   while (!$rs->EOF) {
       set_time_limit(0);
       echo "<td>CP # <br>".$rs->Fields("PC_Number")."</td>";   
       echo "<td>".$rs1->Fields("EmployeeName")."</td>";    
       echo "<td>".$rs2->Fields("FA_TypeID")."</td><tr>";   

      $rs->MoveNext();
      $rs1->MoveNext();
   }
   echo "</table>";   
   $rs->Close();
       ?>   

我如何将 $rs->Fields("PC_Number") 放入将提交到新表单的列表框中

4

1 回答 1

0

如果$rs->Fields("PC_Number")不是数组,则可以使用它。如果它是数组,则必须使用循环语句...这将为您提供一个仅包含一个选项的列表框。

<select>
   <option value="1"><?php echo $rs->Fields("PC_Number");?></option>
</select>
于 2013-01-21T06:31:21.020 回答