php
1try{ 2 3 include 'config.php'; 4 session_start(); 5 6 $pdo = new PDO($dns,$id,$pass); 7 8$sql = <<<EOF 9UPDATE tbl_post Set 10category = :cateegory, 11title = :title, 12pow = :pow, 13ints = :ints, 14spd = :spd, 15vit = :vit, 16luk = :luk, 17bole = :bole, 18descrp = :descrp 19Where post_id = :postid 20And userid Like :userid 21EOF; 22 23 $stmt = $pdo->prepare($sql); 24 25 $stmt->bindValue(':userid',$_SESSION['userid'],PDO::PARAM_STR); 26 $stmt->bindValue(':category',$_POST['Category'],PDO::PARAM_STR); 27 $stmt->bindValue(':title',$_POST['Title'],PDO::PARAM_STR); 28 $stmt->bindValue(':pow',$_POST['Pow'],PDO::PARAM_INT); 29 $stmt->bindValue(':ints',$_POST['Int'],PDO::PARAM_INT); 30 $stmt->bindValue(':spd',$_POST['Spd'],PDO::PARAM_INT); 31 $stmt->bindValue(':vit',$_POST['Vit'],PDO::PARAM_INT); 32 $stmt->bindValue(':luk',$_POST['Luk'],PDO::PARAM_INT); 33 $stmt->bindValue(':bole',$_POST['Bole'],PDO::PARAM_INT); 34 $stmt->bindValue(':descrp',$_POST['Descr'],PDO::PARAM_STR); 35 $stmt->bindValue(':postid',$_POST['postid'],PDO::PARAM_INT); 36 37 $flg = false; 38 $flg = $stmt->execute(); 39 40 if ($flg == true){ 41 echo 'OK'; 42 }else{ 43 echo 'ERROR'; 44 } 45 46}catch(PDOException $e){ 47 echo $e; 48}
SQLSTATE[HY093]という、エラーがでて前に進みません。
どのようなエラーなのか、
どこが間違っているのかというのが教えていただきたい点です。
ポストや、セッションは全部来ていると思います。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/05/17 09:34