我正在尝试创建脚本,该脚本将在单击按钮时检查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>
但是它仅显示“已成功连接”,仅此而已