Advertisement
Guest User

pdo

a guest
May 8th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. $statement = $pdo->prepare('INSERT INTO `a_temp_session` (`id`, `session_id`, `topTextOrLogo`, `topText`, `sideFirstTextOrLogo`, `sideFirstText`, `topLogo`, `sideFirstLogo`, `insideTextOrLogo`, `insideText`, `insideLogo`, `image`) VALUES (:id, :session_id, :topTextOrLogo, :topText, :sideFirstTextOrLogo, :sideFirstText, :topLogo, :sideFirstLogo, :insideTextOrLogo, :insideText, :insideLogo, :image)');
  2.  
  3. $stmtValue = 'Tekst';
  4.  
  5. $statement->bindValue(':session_id', $ses_id, PDO::PARAM_STR);
  6. $statement->bindValue(':topTextOrLogo', 0, PDO::PARAM_INT);
  7. $statement->bindValue(':topText', $stmtValue, PDO::PARAM_STR);
  8. $statement->bindValue(':sideFirstTextOrLogo', 0, PDO::PARAM_INT);
  9. $statement->bindValue(':sideFirstText', $stmtValue, PDO::PARAM_STR);
  10. $statement->bindValue(':topLogo', 0, PDO::PARAM_STR);
  11. $statement->bindValue(':sideFirstLogo', 0, PDO::PARAM_STR);
  12. $statement->bindValue(':insideTextOrLogo', 0, PDO::PARAM_INT);
  13. $statement->bindValue(':insideText', $stmtValue, PDO::PARAM_STR);
  14. $statement->bindValue(':insideLogo', 0, PDO::PARAM_STR);
  15. $statement->bindValue(':image', 0, PDO::PARAM_STR);
  16.  
  17. $statement->execute();
  18.  
  19.  
  20.  
  21. Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number in /public_html/index2.php:44 Stack trace: #0 /public_html/index2.php(44): PDOStatement->execute() #1 {main} thrown in /public_html/index2.php on line 44
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement