프로시저 본문이
Update bbs_event Set bbs_content = in_str_bbs_content Where bbs_id = in_bbs_id;
Select bbs_subject into out_subject from bbs_event Where bbs_id = in_bbs_id ;
간단한 두 줄입니다.
인자값으로 in_str_bbs_content (text) / in_bbs_id(int)
아웃 파라메터로 out_subject
$content = "abcded " ;
$num = 1 ;
$pdo = new PDO($dbcon,$dbuser,$dbpass) ;
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION) ;
$stmt = $podo->prepare("call sp_check(?,? ,? )") ;
$stmt->bindParam(1,$num) ;
$stmt->bindParam(2,$content) ;
$stmt ->bindParam(3, $tmp , PDO::PARAM_STR|PDO::PARAM_OUTPUT, 4000) ;
$stmt->execute() ;
이렇게 하면 작동이 되지 않네요.
php에서 PDO를 이용해서 mysql 프로시저 값을 어떻게 받아 와야하나요?
또 ,
$content = "abcded " ;
$num = 1 ;
$pdo = new PDO($dbcon,$dbuser,$dbpass) ;
$pdo->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION) ;
$stmt = $podo->prepare("call sp_check(?,? ,@ )") ;
$stmt->bindParam(1,$num) ;
$stmt->bindParam(2,$content) ;
$stmt->execute() ;
이렇게 하면 값은 수정이 되는데 반환되는 값을 받아 올 수 없습니다.
프로시저를 이용해서 반환되는 값을 받아 오려면 어떻게 해야 하는지
알려 주세요
|