PDO is much better option for calling procedures, views or triggers of mysql 5.x versions from PHP instead of using mysqli extension. Following is a simple demo script which can help anybody on how to call and use mysql procedures through php
try {
$dbh = new PDO('mysql:host=xxx;port=xxx;dbname=xxx', 'xxx', 'xxx', array( PDO::ATTR_PERSISTENT => false));
$stmt = $dbh->prepare("CALL getname()");
// call the stored procedure
$stmt->execute();
echo "<B>outputting...</B><BR>";
while ($rs = $stmt->fetch(PDO::FETCH_OBJ)) {
echo "output: ".$rs->name."<BR>";
}
echo "<BR><B>".date("r")."</B>";
} catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}