如何根据按钮单击触发的值在PHP / MySQL中获取消息?

时间:2019-06-13 17:46:52

标签: php html mysql

我正在尝试创建脚本,该脚本将在单击按钮时检查member_profile中的点,并且不确定是否应该使用HTML。

如果点小于10,请说出任何信息,例如:

  

你没有10分

如果您有10以上的邮件,请发送$firstName的POST到time.php并重定向。

这是我的PHP代码:

        $servername = "db.mysql-xxx.gsp-europe.net";
    $username = "sql_xxxx";
    $password = "xxxxxxxxxxx";
    $dbname = "sql_xxxx";


    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);

    // Check connection
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    } 
    echo "Connected successfully";

     $result = mysql_query("SELECT * FROM member_profile user_id = '$firstName'");
        $ar = mysql_fetch_assoc($result);

        if ($ar['points'] >= '10')  // Whatever your field name is
        {
    ?>
     echo YEEY, You have 10 pointz. ; 
    <?php
        }

<html>SUM HTML HERE</html>

但是它仅显示“已成功连接”,仅此而已

0 个答案:

没有答案