【问题标题】:Use ISSET from some of the examples here on stackoverflow Error on the Code在 stackoverflow 上的一些示例中使用 ISSET 代码错误
【发布时间】:2015-02-04 18:00:58
【问题描述】:

我认为我没有正确编写代码。有人可以看看这个吗?我是php新手!

<?php 
// Create Connection
$connect = mysqli_connect('localhost','root','test123','joomla');

// Check Connection
if(mysqli_connect_errno($connect)) {
    echo 'Failed to connect to DataBase| '. mysqli_connect_error();
}
?>

我在 url 参数中如果 rp_id 不存在的情况下添加了if(issets($_GET['rp_id'])) - 它只是关闭数据库

<?php 
if(issets($_GET['rp_id]')) {
    $rp_id = htmlspecialchars($_GET["rp_id"]);
    // open record with evdet_id =$rp_id
    $result = mysqli_query($connect,"SELECT * FROM n0dap_jevents_vevdetail WHERE    evdet_id =".$rp_id);

    while($row = mysqli_fetch_array($result)): 
        $value = $row['google_map'];
        echo $value;
        endwhile;
    }

    $connect->close();
    //if the rp_id does exist the go ahead and run the top otherwise close it.  
} else { 
    $connect->close();
}
?>

【问题讨论】:

标签: php mysql get isset


【解决方案1】:
if(issets($_GET['rp_id]))

看起来你在 isset() 上打错了。

调用未定义函数issets()

这意味着您正在尝试将 issets() 作为函数调用,但事实并非如此。 您正在寻找的函数是 isset()。如果您将issets() 替换为isset(),您将不会再收到该错误消息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-18
    • 2013-11-21
    • 2017-09-15
    • 1970-01-01
    • 1970-01-01
    • 2015-11-15
    • 2018-07-17
    • 2017-04-02
    相关资源
    最近更新 更多