Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ php -a
- Interactive mode enabled
- php > $s = "localhost";
- php > $u = "root";
- php > $p = "123456"
- php > $d = "fuel_dev";
- PHP Parse error: syntax error, unexpected '$d' (T_VARIABLE) in php shell code on line 2
- php > $p = "123456";
- php > $d = "fuel_dev";
- php > $conn = new PDO("mysql:host=$s;dbname=$d;", $u, $p);
- php > $sql = "update posts set title=:title, body=:body where id=:id";
- php > $stmt = $conn->prepare($sql);
- php > $stmt->bindParam(:title, 'lets edit this');
- PHP Parse error: syntax error, unexpected ':' in php shell code on line 1
- php > $stmt->bindParam(':title', 'lets edit this');
- PHP Warning: Uncaught Error: Cannot pass parameter 2 by reference in php shell code:1
- Stack trace:
- #0 {main}
- thrown in php shell code on line 1
- php > $stmt->bindParam(':body', 'lets also edit this');
- PHP Warning: Uncaught Error: Cannot pass parameter 2 by reference in php shell code:1
- Stack trace:
- #0 {main}
- thrown in php shell code on line 1
- php > $stmt->bindParam(':id', '2');
- PHP Warning: Uncaught Error: Cannot pass parameter 2 by reference in php shell code:1
- Stack trace:
- #0 {main}
- thrown in php shell code on line 1
- php > $r = $stmt->execute();
- PHP Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: no parameters were bound in php shell code on line 1
- php > echo $stmt ? "one" : "zero"
- php > ;
- one
- php >
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement