Jump to content

[RESOLU]insert Ignore? Db::getInstance()->insert_ignore($table, $data,false,true,Db::INSERT_IGNORE);


Recommended Posts

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

C'est cela.

 

J'ai d'abord tenter:

Db::getInstance()->insert_ignore(...

 

 

Puis j'ai découvert:

 

Le parametre

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

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