piR-web Posted October 1, 2017 Share Posted October 1, 2017 (edited) Bonjour, Je viens d'intégrer un champ texte dans la table Specific Price et je souhaite mettre à jour ma base de donnée lorsque le champ est modifier : Voici le code que j'ai intégré mais il ne fonctionne pas : if(isset($_POST['marquage_promo'])) { $sql = "SELECT * FROM "._DB_PREFIX_."specific_price WHERE id_product=".(int)$id_product; $res=Db::getInstance()->ExecuteS($sql); $marquage_promo = $_POST['marquage_promo']; if (count($res)) { if ($marquage_promo) { $sql = "UPDATE "._DB_PREFIX_."specific_price SET marquage_promo=".$marquage_promo." WHERE id_product=".(int)$id_product; Db::getInstance()->Execute($sql); }else{ $sql = "DELETE mon_champ FROM "._DB_PREFIX_."specific_price WHERE id_product=".(int)$id_product; Db::getInstance()->Execute($sql); } }else{ $sql = "INSERT INTO "._DB_PREFIX_."specific_price (id_product,marquage_promo) VALUES (".(int)$id_product.",".$marquage_promo.")"; Db::getInstance()->Execute($sql); } } Pouvez-vous m'aider ? Merci beaucoup Edited October 2, 2017 by piR-web (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