所以现在当我从 DB 获得积分时,我想将 5 个积分添加到 [points] 并保存到 DB:
function addPoints($email)
{
$con = mysql_connect("example", "example", "example") ;
if (!$con)
{
die("Can not connected: " . mysql_error());
}
mysql_select_db("example",$con);
$sql = "SELECT points FROM tablename WHERE email = '$email'";
$myData = mysql_query($sql,$con);
while($record = mysql_fetch_array($myData))
{
$record['points'];
}
mysql_close($con);
}