MySQLi查询不起作用

时间:2017-10-17 13:34:45

标签: php mysql mysqli

我正在将我的网站从MySQL转换为MySQLi,但我的所有查询都已停止工作。

我已经尝试了所有内容,但查询没有在数据库中输入任何内容,我将提供一些不起作用的查询。

我在哪里犯了错误?

    $sql             = array();
    $sql             = "SELECT my_mailban,mban_reason 
                              FROM members
                              WHERE playerid = '" . mysqli_real_escape_string($con, $_SESSION['playerid']) . "'";
    $mb               = array();
    $mb               = mysqli_fetch_array(mysqli_query($con, $sql));
    $_POST['message'] = stripslashes($_POST['message']);
    $_POST['subject'] = stripslashes($_POST['subject']);
    $_POST['to']      = abs(intval($_POST['to']));

$ sql = array();

$sql = "INSERT INTO member_mail
                                 VALUES ('NULL',
                                         '" . mysqli_real_escape_string($con, $_POST['to']) . "',
                                         '" . mysqli_real_escape_string($con, $_SESSION['playerid']) . "',
                                         '" . mysqli_real_escape_string($con, $_POST['subject']) . "',
                                         '" . mysqli_real_escape_string($con, $_POST['message']) . "',
                                         unix_timestamp(),
                                         '0')";
            mysqli_query($con, $sql);

谢谢

0 个答案:

没有答案