我在html页面中有此php代码,如何从回显中使用...。
$stid = oci_parse($conn, "select user_id, username,user_job from users");
oci_execute($stid);
while (($row = oci_fetch_array($stid,OCI_ASSOC+OCI_RETURN_NULLS))!= false){
echo $row['user_id'] . " " . $row['username'] .$row['user_job'] . "<br>\n";
}
答案 0 :(得分:1)
您可以执行以下操作:
$stid = oci_parse($conn, "select user_id, username,user_job from users");
oci_execute($stid);
echo "<select>";
while (($row = oci_fetch_array($stid,OCI_ASSOC+OCI_RETURN_NULLS))!= false){
echo "<option value=$row[user_id]>". $row['username'] .$row['user_job'] . "</option>";
}
echo "</select>";