fmandile Posted June 17, 2019 Share Posted June 17, 2019 Bonjour, J'aimerais pouvoir exécuter une requête SQL dès lors que j'appui sur un <a href="#"> Pour ce faire j'ai commencé à faire ceci : public function displayAddLink($token = null, $id, $name = null){ $tpl = $this->createTemplate('helpers/list/list_action_edit.tpl'); if (!array_key_exists('Add', self::$cache_lang)) self::$cache_lang['Add'] = $this->l('Add', 'Helper'); $data = array( 'id_list' => NULL, 'id_manufacturer' => $id, 'name' => $name, ); $ajoutDb = Db::getInstance()->insert('manufacturer_list', $data); $tpl->assign(array( 'href' => $ajoutDb, 'action' => self::$cache_lang['Add'], 'id' => $id )); return $tpl->fetch(); } J'ai crée un addRowAction que j'ai appelé "add", et une fois le href cliqué j'aimerai insérer une donnée dans la BDD mais je n'y arrive pas. Merci d'avances pour vos réponses. 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