I'm struggling with doing this, I want to basically do a database deleteAll where one field is equal to something and another field must NOT be equal to something.. its for deleting duplicate rows so I want to delete all but one row.. the way I tried below isn't working, I Would appreciate any advice:
$conditions = array (
"Prox.proxy" => $currentproxytocheck,
"AND" => array (
"NOT" => array (
"Prox.proxyid" => $currentproxyid
)
)
);
$this->Prox->deleteAll(array( 'conditions' => $conditions));
EDIT:
The printout of my $conditions array is:
Array
(
[Prox.proxy] => 62.58.179.2:80
[AND] => Array
(
[NOT] => Array
(
[Prox.proxyid] => 36829
)
)
)
Error from CAkephp:
Notice (8): Array to string conversion [CORE/cake/libs/model/datasources/dbo_source.php, line 2193]
Warning (512): SQL Error: 1054: Unknown column 'conditions' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 673]