Jump to content

Insertion champ dans Specific Price


Recommended Posts

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 by piR-web (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...