php - combobox没有编入索引

时间:2017-01-17 01:14:45

标签: php combobox

我想问为什么我的组合框没有编入索引?

这是一个代码

class bootstrapping(object):

    def __init__(self,hours=[]):
        self.hours = hours

    def CI(self,hours):
        from random import randint
        x=0
        for numbers in range(0,1000):
            bootstraplist = []
            while x >= 0:
                bootstraplist.append(hours[randint(0,6)])
            if x <= 5:
                x += 1
                continue
            else:
                break
        listofmeans.append(sum(bootstraplist) / len(bootstraplist))
        import numpy
        s = numpy.std(listofmeans)
        z = 1.96

        lower_confidence = (sum(listofmeans) / len(listofmeans)) - z*s
        upper_confidence = (sum(listofmeans) / len(listofmeans)) + z*s

        return "Lower confidence:",lower_confidence,"Upper confidence:",upper_confidence

这是动作代码

<form method="post" action="../php/proses-list-maintenance.php">
    <p style="font-size:15px; font-family:Coda; color:black;">Pilih Aplikasi :</p>
    <select name="comboapp" class="form-control">
        <?php foreach ($list_app as $app) : ?>
            <option value="<?php echo $app['application_id'] ?>"><?php echo $app['application_name'] ?></option>
        <?php endforeach ?>
    </select>
    <button type="submit" class="btn btn-success">Pilih</button>                 
</form>

当我跑步时,我收到了这个通知

include '../koneksi.php';

$id = $_POST['comboapp'];
$query = "select * from application where application_id = '$id'";
$hasil = mysqli_query($db, $query);
$data_app = mysqli_fetch_assoc($hasil);

$query2 = "SELECT * FROM maintenance where maintenance_id = '$id'";
$hasil2 = mysqli_query($db, $query2);

if ($hasil == true && $hasil2 == true) {
    echo "<script>location.href='../admin/list-maintenance.php?aaa='+$id</script>";
    $data_app = array();
    while ($row = mysqli_fetch_assoc($hasil)) {
        $data_app[] = $row; 
    }
    $data_man = array();
    while ($row = mysqli_fetch_assoc($hasil2)) {
        $data_man[] = $row; 
    }
}

选择组合框并单击按钮时。我希望组合框中的数据ID输入数据到$ id

0 个答案:

没有答案