Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: Condition object: Edit Log

Here is the list of edits for this post
Condition object
OK, I have tried several times in different plugins to get a condition object to work, but never can, talk about frustrating. The first time it was throwing an error relating to primary keys, the errors were saying that my table had 4 keys as the primary but I was only providing 2, and in fact it only had 2 - the table on had 3 fields, but that is not my current problem coz I wrote a work around there. Sorry about the whinge but this has been eating at me, has anyone else had problems with the condition object?

Ok, currently what I want to do is delete records from a table if the ID is not located in a list, I have code like this:

$table = $DB->table('myTable');
$condition = GT::SQL::Condition->new('ID', 'NOT IN', @ids);
$table->delete($condition);

where @ids contains the list of ids that I want to keep. I got some error that mentioned my query was of the form 'NOT IN 1 AND 2, 3, 4' .

Can someone perleeeease help me?

Thank you in advance for any feedback as I am at my wits end.

Last edited by:

tommyfotak: Oct 9, 2002, 2:22 PM

Edit Log: