kiki57 Posted March 1, 2015 Share Posted March 1, 2015 (edited) Bonjour, Je souhaite récupérer les variables d'un formulaire créé en BO et modifier ma BDD Voila mon formulaire .tpl: <form action="#" method="post"> <table> </br> <thead> <tr> <th>{l s='Id'}</th> <th>{l s='specialité'}</th> ... </tr> <tbody> <!-- Corps du tableau --> {foreach key=k item=i from=$tableau} <tr> <td><input type="text" name="id-[]" value="{$i.id_customer}"/></td> <td><input type="text" name="speciality-[]" value="{$i.speciality}"/></td> ... </tr> {foreachelse} <td>{l s='Aucun élément n\'a été trouvé dans la recherche'}</td> {/foreach} </tbody> </table> <br /><input name="submit" type="submit" value="" /><br /> </form> mon .php pour le traitement if (Tools::isSubmit('submit')) { foreach(Tools::getValue('id-') as $i=>$val) { Db::getInstance()->execute('UPDATE `'._DB_PREFIX_ .'customer` SET `speciality` = '.Tools::getValue('speciality-')[$i].' WHERE `id_customer` = '.Tools::getValue('id-')[$i]); [spam-filter] mais impossible de modifier ma table, pouvez-vous m'aider? Edited March 1, 2015 by kiki57 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now