Jump to content

Recommended Posts


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);

			'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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More