Advertisement
Guest User

Untitled

a guest
Jan 27th, 2017
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ php -a
  2. Interactive mode enabled
  3.  
  4. php > $s = "localhost";
  5. php > $u = "root";
  6. php > $p = "123456"
  7. php > $d = "fuel_dev";
  8. PHP Parse error:  syntax error, unexpected '$d' (T_VARIABLE) in php shell code on line 2
  9. php > $p = "123456";
  10. php > $d = "fuel_dev";
  11. php > $conn = new PDO("mysql:host=$s;dbname=$d;", $u, $p);
  12. php > $sql = "update posts set title=:title, body=:body where id=:id";
  13. php > $stmt = $conn->prepare($sql);
  14. php > $stmt->bindParam(:title, 'lets edit this');
  15. PHP Parse error:  syntax error, unexpected ':' in php shell code on line 1
  16. php > $stmt->bindParam(':title', 'lets edit this');
  17. PHP Warning:  Uncaught Error: Cannot pass parameter 2 by reference in php shell code:1
  18. Stack trace:
  19. #0 {main}
  20.   thrown in php shell code on line 1
  21. php > $stmt->bindParam(':body', 'lets also edit this');
  22. PHP Warning:  Uncaught Error: Cannot pass parameter 2 by reference in php shell code:1
  23. Stack trace:
  24. #0 {main}
  25.   thrown in php shell code on line 1
  26. php > $stmt->bindParam(':id', '2');
  27. PHP Warning:  Uncaught Error: Cannot pass parameter 2 by reference in php shell code:1
  28. Stack trace:
  29. #0 {main}
  30.   thrown in php shell code on line 1
  31. php > $r = $stmt->execute();
  32. PHP Warning:  PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: no parameters were bound in php shell code on line 1
  33. php > echo $stmt ? "one" : "zero"
  34. php > ;
  35. one
  36. php >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement