Hi,
i am french and it is difficult to explain my problem.
i make an form with chronoform v5, i want to delete a row of my base and i don't do it yet !
i made a program in php that works perfectly out of chronoform but when I include it in custom code the line is not deleted. I have been searching for a few days and I despair of finding a solution.
I am adding the code I put in the custom code;
Thank you in advance for you answer
i am french and it is difficult to explain my problem.
i make an form with chronoform v5, i want to delete a row of my base and i don't do it yet !
i made a program in php that works perfectly out of chronoform but when I include it in custom code the line is not deleted. I have been searching for a few days and I despair of finding a solution.
I am adding the code I put in the custom code;
Thank you in advance for you answer
<?php
try
{
// On se connecte à MySQL
$bdd = new PDO('mysql:host=localhost;dbname=essai_cf', 'root', '');
}
catch(Exception $e)
{
// En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : '.$e->getMessage());
}
echo 'base ouverte';
$num =$form -> data['id'];
$bdd->exec("DELETE from numéro WHERE id ='$num' ");//
echo 'La fiche '.$num.' a été supprimée';
?>