$sql = 'insert into user(account,password,mail,phone,) VALUES ('.$account.','.$password.','.$mail.','.$phone.')';
$query = $this->link->query($sql);
往数据库插入数据时,VALUES括号内要以变量的形式书写,像上面这种书写方式正不正确?
$sql = 'insert into user(account,password,mail,phone,) VALUES ('.$account.','.$password.','.$mail.','.$phone.')';
$query = $this->link->query($sql);
往数据库插入数据时,VALUES括号内要以变量的形式书写,像上面这种书写方式正不正确?
$sql = "insert into user(account,password,mail,phone) VALUES ('".$account."','".$password."','".$mail."','".$phone."')";
$sql = "insert into user(account, password, mail, phone) VALUES ('{$account}', '{$password}', '{$mail}', '{$phone}')";
2 回答1.5k 阅读✓ 已解决
1 回答1.2k 阅读✓ 已解决
2 回答895 阅读✓ 已解决
1 回答1.1k 阅读✓ 已解决
2 回答955 阅读
1 回答934 阅读
1 回答857 阅读
查一下PHP字符串的表示方式,单引号和双引号的区别