note 95867 added to mysqli-stmt.bind-result
| From: | baldr dot theinnocent at gmail dot com | Date: | Tue, 26 Jan 2010 20:56:39 +0000 |
| Subject: | note 95867 added to mysqli-stmt.bind-result | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165332@lists.php.net to get a copy of this message | ||
hi how do you return variables from a prepared statment. i have the following
stored procedure
#########################
CREATE DEFINER=
root@localhost PROCEDURE sp_register_user(
IN p_username VARCHAR(255),
IN p_pass VARCHAR(255),
IN p_email VARCHAR(255),
OUT p_userid INT
)
BEGIN
INSERT INTO users (username, pass, email, confirmed)
VALUES ( p_username, SHA1(p_pass),p_email, FALSE);
SET @a=LAST_INSERT_ID();
SELECT @a INTO p_userid;
INSERT INTO activation (email, activationcode, userid)
VALUES (p_email, SHA1(now()), @a);
END
#########################
php code
#########################
if($query = $con->prepare ("CALL sp_register_user(?,?,?,?)")){
$query->bind_param("sssi", $user, $pass, $email, $result);
$query->execute();
$query->close();
#########################
coould anyone let me know what im doing wrong
----
Server IP: 69.147.83.197
Probable Submitter: 87.194.94.81
----
Manual Page -- http://www.php.net/manual/en/mysqli-stmt.bind-result.php
Edit -- https://master.php.net/note/edit/95867
Del: integrated -- https://master.php.net/note/delete/95867/integrated
Del: useless -- https://master.php.net/note/delete/95867/useless
Del: bad code -- https://master.php.net/note/delete/95867/bad+code
Del: spam -- https://master.php.net/note/delete/95867/spam
Del: non-english -- https://master.php.net/note/delete/95867/non-english
Del: in docs -- https://master.php.net/note/delete/95867/in+docs
Del: other reasons-- https://master.php.net/note/delete/95867
Reject -- https://master.php.net/note/reject/95867
Search -- https://master.php.net/manage/user-notes.php