Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
要获取所选下拉列表名称php的id吗_Php - Fatal编程技术网

要获取所选下拉列表名称php的id吗

要获取所选下拉列表名称php的id吗,php,Php,我有两张桌子,封面和书 封面: id number, Case_name varchar(20) (数据库表中的Case_name条目:good、bad、none) 书籍: 我有一本书的表格: <div class="row-form" style="margin-top: -19px;"> <div class="span3" style="margin-top: 06px">Book_name:</div> <

我有两张桌子,
封面

封面:

id            number,
Case_name     varchar(20)
(数据库表中的Case_name条目:good、bad、none)

书籍:

我有一本书的表格:

<div class="row-form" style="margin-top: -19px;">
  <div class="span3" style="margin-top: 06px">Book_name:</div>
  <div class="span9"><input type="text" name="bookname"/></div>
</div>

<div>

<select name='cstatus' style="width: 100%;">;

<?php
$user = "fyp";
$pass = "fyp";
$host = "localhost/CRMP";

// Connection with the Oracle.
$con = oci_connect($user, $pass, $host);

// Prepares an Oracle statement for execution.
$query = oci_parse($con,"SELECT id, Case_name FROM Cover");

// Executes a statement.                                                                           oci_execute($query);

while($row = oci_fetch_array($query))
{
   echo "<option value='".$row['id']."'>".$row['Case_name'].'</option>';
}
?>
 </select>
</div>

oci\u parse()之后使用记住调用
oci\u execute()
<div class="row-form" style="margin-top: -19px;">
  <div class="span3" style="margin-top: 06px">Book_name:</div>
  <div class="span9"><input type="text" name="bookname"/></div>
</div>

<div>

<select name='cstatus' style="width: 100%;">;

<?php
$user = "fyp";
$pass = "fyp";
$host = "localhost/CRMP";

// Connection with the Oracle.
$con = oci_connect($user, $pass, $host);

// Prepares an Oracle statement for execution.
$query = oci_parse($con,"SELECT id, Case_name FROM Cover");

// Executes a statement.                                                                           oci_execute($query);

while($row = oci_fetch_array($query))
{
   echo "<option value='".$row['id']."'>".$row['Case_name'].'</option>';
}
?>
 </select>
</div>
Cover Table:
------------
id       Case_name
1        good
2        bad
3        none

Book table:
----------
id        booK_Name          Cover
1         Alp                1(not the name "good")