douyicao2199 2015-03-22 04:11
浏览 43

为什么第二次使用搜索会导致它停止下拉列表?

I have a jQuery drop down list that uses first CARS then secondly, the models from that car. Then, when the second choice is made - hit a submit button and search for the tire that the car uses. It works great the first time, but the second time, it stops and I have to reload the page to get it to work again. Any ideas of why this is happening would be helpful. My code example is here:

Accessing a variable from inside a jquery drop down list?

Here is the code that searches:

function findtire() {
    global $db;
    if (isset($_POST['car'])) {
        $_SESSION['car'] = $_POST['car'];
        $car = $_SESSION['car'];
    }

    if (isset($car)) {
        $query = $db->prepare("SELECT idtires FROM vehicle WHERE idcarmodel = '$car'");
        $query->execute();
        $tire = $query->fetchAll();
    }

    if (isset($tire)) {
        echo "<ul>";
        foreach ($tire as $name) {
            echo "<li id='tiresearch'>";
            echo "Tire Size is Available: " . $name['idtires'];
            echo "</li>";
        }
        echo "</ul>";
    }
    else {
    }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比
    • ¥15 winform的chart曲线生成时有凸起
    • ¥15 msix packaging tool打包问题
    • ¥15 finalshell节点的搭建代码和那个端口代码教程
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作