hi all , I had create a procedure stored in mysql 5.1 this is its code:
and i try to call him in php to use this code:
but the code would not work and i don't no what the probleme if can anywone can help me please?
(ps sorry for my bad english i'm french women ....)
Code:
CREATE PROCEDURE `verif_numtel` (IN login varchar(10), IN numero INT,INOUT erreur INT) DETERMINISTIC BEGIN SET erreur= 0; IF(numero<0) THEN SET erreur= 1; ELSE INSERT INTO Membre_de_bureau (loginMB,num_telMB) VALUES (login, numero); END IF; END;//
Code:
try
{
$bdd = new PDO('mysql:host=localhost;dbname=club_investissement1', '****', '****');
}
catch (Exception $e)
{
die('Erreur : ' . $e->getMessage());
}
$log = 'prince';$numtel = 555; $err = 0;
$req =$bdd->prepare("CALL verif_numtel(?,?,?)");
$req->bindParam(1, $log, PDO::PARAM_STR, 10);
$req->bindParam(2, $numtel, PDO::PARAM_INT);
$req->bindParam(3, $err, PDO::PARAM_INT|PDO::PARAM_INPUT_OUTPUT);
$req->execute();
print "procedure returned $err \n";
(ps sorry for my bad english i'm french women ....)
Comment