MySQL Forums
Forum List  »  Russian

Хранимые процедуры + PHP
Posted by: Valentin Borisenko
Date: October 20, 2009 12:34PM

Всем привет, помогите разобраться с хп.

Простой пример:

CREATE PROCEDURE select_data (in id int, out result int)
BEGIN
SET @rs = concat('select name from names where id=', id);
PREPARE rs FROM @rs;
EXECUTE rs;
SET result = rs;
END

Правильно ли он написан?

Теперь я так понимаю, что из PHP мне нужно вызвать хп так: call select_data(1, @result); ?
А как теперь получить в PHP @result - чтобы дальше с ним работать?

Спасибо.

-----
Deadangel is falling ...

Options: ReplyQuote


Subject
Views
Written By
Posted
Хранимые процедуры + PHP
7933
October 20, 2009 12:34PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.