MySQL retrieve variable from Stored Procedure in PHP PDO

前端 未结 2 1457
野趣味
野趣味 2020-11-28 12:46

I\'ve seen this question asked a load of times, but they\'re all really long, and I just can\'t get my head around what they\'re doing ... So, could someone tell me how to g

2条回答
  •  离开以前
    2020-11-28 13:31

    let me preface this by saying it's a guess, as I NEVER use prepared statements...

    typically you don't bind your return val, you do this

    $status = $statement->execute(  );
    
    $resultArray = $statement->fetchAll( );
    $statement->closeCursor( );
    if (!is_array($resultArray)) {
        return array();
    }
    return $resultArray[0]['returnid'];
    

    take it with a grain of salt...

提交回复
热议问题