我想隐藏所有#DIV/0!错误和未输入数据的#N/A错误.(所以只有一个空单元格.)我当前的数据:

我有一个注册表单,允许用户创建用户名和密码,然后存储在数据库中.
<?php
//values to be inserted in database table
//session_start();
include('connect.php');
//Fixed cost of 10 to fit server req
//Random salt to be added to the pass
$options = [
'cost' => 10,
'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),
];
$email = $_POST['email'];
$password= password_hash($_POST['password'], PASSWORD_BCRYPT, $options);
$username= $_POST['username'];
$query = "INSERT INTO users (username, email, password) VALUES(?, ?, ?)";
$statement = $mysqli->prepare($query);
//bind parameters for markers, where (s = string, i = integer, d = double, b = blob)
$statement->bind_param('sss', $username, …Run Code Online (Sandbox Code Playgroud) 我正在创建一个游戏,背景颜色一开始就是白色的:
self.backgroundColor = SKColor.whiteColor()
Run Code Online (Sandbox Code Playgroud)
所以当游戏开始时白色是背景。我有一个评分系统,所以本质上我希望在达到一定分数时颜色发生变化,因此:
if score < 100{
enemy.runAction(SKAction.moveTo(mainBall.position, duration:3))
}
else if score >= 100 && score < 200{
enemy.runAction(SKAction.moveTo(mainBall.position, duration:2.5))
self.backgroundColor = SKColor.purpleColor()
}
else if score >= 200 && score < 300{
enemy.runAction(SKAction.moveTo(mainBall.position, duration:2))
self.backgroundColor = SKColor.greenColor()
}
Run Code Online (Sandbox Code Playgroud)
然而,老实说,这种方法非常笨拙,看起来非常糟糕。我的游戏中的所有内容都是流畅的,并且在使用以下方式从场景中移除时包含淡入淡出:
livesLabel.runAction(SKAction.fadeInWithDuration(0.5))
Run Code Online (Sandbox Code Playgroud)
但我不确定如何使用背景颜色来做到这一点。如果我将上面的示例与背景颜色一起使用,例如
self.backgroundColor = SKAction.fadeInWithDuration(SKColor.purpleColor())
Run Code Online (Sandbox Code Playgroud)
我收到错误“无法使用类型为‘(UIColor)’的参数列表调用‘fadeInWithDuration’”
注意:我完全理解尝试为动画分配背景颜色是愚蠢的。但我把代码放在那里试图解决我的问题
当用户输入他们的ID我希望它具有特定格式时,他们大多在评论中解释.我想知道他们是否更容易更有效地这样做.另外,是否有办法将输入的字母更改为我完成代码的方式或任何其他方法.
private boolean setCustomerID(String id) {
//Validates the customerID contains 3 letters a hypthen then 4 numbers
if ((id.charAt(0) < 'A' || id.charAt(0) > 'Z')
|| (id.charAt(1) < 'A' || id.charAt(1) > 'Z')
|| (id.charAt(2) < 'A' || id.charAt(2) > 'Z')
|| (id.charAt(3) != '-')
|| !isDigit(id.charAt(4))
|| !isDigit(id.charAt(5))
|| !isDigit(id.charAt(6))
|| !isDigit(id.charAt(7))) {
return false;
//Checks the user enters P, B or C for first letter
} else if ((id.charAt(0) == 'P' || id.charAt(0) == 'B' || id.charAt(0) == …Run Code Online (Sandbox Code Playgroud) background ×1
fade ×1
ios ×1
java ×1
login ×1
performance ×1
php ×1
sprite-kit ×1
swift ×1
validation ×1