Mysqli Method
Procedure

  DROP PROCEDURE IF EXISTS prSample1;
  CREATE PROCEDURE prSample1(OUT Name VARCHAR(255))
  BEGIN
    SET Name = 'Mugil';
    SELECT Name;
  END;

Call to Procedure From PHP

  $Conn = new mysqli('localhost', 'root', '', 'metroplots');				

  $strSQL = "CALL prSample1(@Name)";
  $stmt   = $Conn->prepare($strSQL);

  $stmt->execute();
  $stmt->bind_result($Name);	

  while($stmt->fetch())
   $strName = $Name;

Leave a reply