mysqli 不会保存数据但显示 html

问题描述 投票:0回答:0

我有这段代码,它显示了 html 部分,但它不会保存我要更新的数据:

<?php
$mysqli = new mysqli("localhost", "rt", "12345", "prac");
$date = date('Y-m-d H:i:s');
$sqlL = "UPDATE `mails` SET `active` = 'true', `activated_at` = '$date' WHERE id = \"".$_SESSION['session']."\"";
if(mysqli_query($mysqli, $sqlL)){
    ?>
    <!doctype html>
    <html class="no-js" lang="zxx">
    
    <head>
        <title>Test</title>
    </head>
    
    <body>
    <p>hello</p>
    </body>
    
    </html>
    <?php
} else {
    echo "ERROR: Could not able to execute $sqlL. " 
                            . mysqli_error($mysqli);
} 
$mysqli->close();
?>

我能做什么? (谢谢)

php html sql database mysqli
© www.soinside.com 2019 - 2024. All rights reserved.