jd440 Posted August 8, 2013 Share Posted August 8, 2013 (edited) Bonjour à tous. J'essaie de faire un insert ignore, mais je me retrouve avec l'erreur suivante: Fatal error: Call to undefined method DbPDO::insert_ignore() in /var/www/html/[...] Pourtant voici mon code: Db::getInstance()->insert_ignore('rsspersocontent', array( 'shop_id' => (int)$shop_id, 'cat_id' => (int)$cat_id, 'url' => pSQL($item->link), 'title' => pSQL($item->title), ),false,true,Db::INSERT_IGNORE); Auriez vous une idée? Edited August 8, 2013 by jd440 (see edit history) Link to comment Share on other sites More sharing options...
Matt75 Posted August 8, 2013 Share Posted August 8, 2013 Salut, Oui cette méthode n'existe pas, il faut utiliser la méthode insert, elle prend un paramètre pour le INSERT IGNORE A+ 1 Link to comment Share on other sites More sharing options...
jd440 Posted August 8, 2013 Author Share Posted August 8, 2013 C'est cela. J'ai d'abord tenter: Quote Db::getInstance()->insert_ignore(... Puis j'ai découvert: Le parametre Quote type = Db::INSERT_IGNORE Mais j'ai mélanger les deux. Donc la bonne version est: Db::getInstance()->insert('rsspersocontent', array( 'shop_id' => (int)$shop_id, 'cat_id' => (int)$cat_id, 'url' => pSQL($item->link), 'title' => pSQL($item->title), ),false,true,Db::INSERT_IGNORE); 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