MySQL Procedure with In Parameter

Dear All,
I have Stored Precudre with In Paramater in My SQL an it is working fine in MySQL Workbench.
Procedure: Nested_Insert_db (IN Comp Varchar 50)

I have created a custom page in PHP maker 2020 with following Code.

I want to call procedure on Click of Submit button and pass Text box string as Procedure parameter.
I tried with following code but didnt get sucess.

<?php if (!isset($_Post["submit"])) { $Comp_v = $_POST['Comp']; $stmt = $dbh->prepare("CALL Nested_Insert_db(?)"); $stmt->bindParam('s',$Comp_v); $stmt->execute(); ?>

Kinldy help me out with right code.

There is no $dbh in your code, you may just use:

Execute(“CALL Nested_Insert_db(‘$Comp_v’)”); // Assume $Comp_v is string

(Also change $_Post to $_POST.)

Or you may simply use Post() global function (v2020) instead of $_POST. Please see the code in the generated phpfn.php file for more info.