$selected_id = -1;
$selected_name = "";
if(isset($_GET['cid'])){
$cid = $_GET['cid'];
$res = $pdo->prepare("SELECT * FROM k WHERE id = :cid");
$res->bindParam(":cid",$cid);
$result = $res->execute();
$rw = $result->fetchAll([$cid]);
if($rw){
$selected_id = $rw['id'];
$selected_name = $rw['ime'];
}
}
我想只选择ID并与已选择的ID进行比较,但总是这个错误可以有人帮助我,请...
答案 0 :(得分:1)
var pic1 = document.getElementById('first');
var pic2 = document.getElementById('sec');
var pic3 = document.getElementById('thi');
pic1.addEventListener('mouseenter', function(){
var div1 = document.getElementById('infOne');
div1.style.opacity=1;
});
pic1.addEventListener('mouseout', function(){
var div1 = document.getElementById('infOne');
div1.style.opacity=0;
});
返回一个布尔值,您将其保存在$res->execute
变量中:
http://php.net/manual/en/pdostatement.execute.php
您没有使用相同的对象,因此您无法使用对象的$result
方法。你应该使用相同的对象,所以你应该这样做:
fetchAll