我的代码:
public function registro($login, $senha, $confsenha, $email, $nick){
$pw = strtoupper(md5($senha));
$pw2 = strtoupper(md5($confsenha));
if (!self::check_login($login)){
if(!self::check_email($email)){ //ok
if($pw == $pw2){
$conexao = new Config;
$conect = $conexao->getConn();
$rg = $conect->prepare("INSERT INTO account (login, Passwd, Email, Nick, Gamepoint)VALUES ('?', '?', '?', '?', ?);");
$rg->bindValue(1, $login);
$rg->bindValue(2, $pw);
$rg->bindValue(3, $email);
$rg->bindValue(4, $nick);
$rg->bindValue(5, 5000); //valor gamepoint
$rg->execute();
}else{
return "<div class='n_error'><p>Confirmação de senha incorreta.</p></div>";
}
}else{
return "<div class='n_error'><p>Email em uso.</p></div>";
}
}else{
return "<div class='n_error'><p>Login em uso.</p></div>";
}
}
致命错误:致命错误:未捕获异常'PDOException',消息'SQLSTATE [HY093]:无效参数编号:绑定变量数与C:\ AppServ \ www \ class \ Cadastro.class中的标记数不匹配' .php:85堆栈跟踪:#0 C:\ AppServ \ www \ class \ Cadastro.class.php(85):PDOStatement-&gt; execute()#1 C:\ AppServ \ www \ cadastrar \ index.php(7 ):Cadastro-&gt; registro('SkelletonX','SkelletonX','SkelletonX','SkelletonX @ gmai ......','SkelletonX')#2 {main}抛出C:\ AppServ \ www \ class \ Cadastro第85行的.class.php
答案 0 :(得分:0)
您需要用
替换您的查询$(document).ready(function() {
$.ajax({
url: "https://restcountries.eu/rest/v2/region/europe"
}).then(function(data) {
var names = new Array();
var capital= new Array();
var borders = new Array();
var subregion = new Array();
for(var i=0;i<data.length;i++){
names.push(data[i].name);
capital.push(data[i].capital);
for(var j=0;j<data[i].borders.length;j++){
borders.push(data[i].borders[j]);
}
subregion.push(data[i].subregion);
}
var evt = new CustomEvent("infoCountries",{
detail:{
nm:names,
totalNames:names.length,
capital: capitales,
borders: borders,
subregion:subregion
}
});
window.dispatchEvent(evt);
});
});