AbanteCart Development > API Development

dataset: delete row with condition AND relation

(1/1)

huyhoang08:
i see dataset API:

--- Code: ---$db=new ADataset('name','key');
//compare single field
$db->deleteRows(array('column_name' => 'field1',  'operator' => '=',  'value' => $value));

--- End code ---
So i want to combine 2 fields with AND/OR relation. how to do this?

huyhoang08:
please help me?

abolabo:

--- Quote from: huyhoang08 on March 17, 2016, 01:46:05 AM ---i see dataset API:

--- Code: ---$db=new ADataset('name','key');
//compare single field
$db->deleteRows(array('column_name' => 'field1',  'operator' => '=',  'value' => $value));

--- End code ---
So i want to combine 2 fields with AND/OR relation. how to do this?

--- End quote ---

please clarify.
What operation do you mean under  "to combine 2 fields with AND/OR" ? deleting?

huyhoang08:
for example, i can use this:

--- Code: ---$db=new ADataset('name','key');
//compare single field
$db->deleteRows(array(
      array('column_name' => 'field1',  'operator' => '=',  'value' => $value1),
      array('column_name' => 'field2',  'operator' => '=',  'value' => $value2),  # AND relationship
));

--- End code ---
I can do this?

abolabo:
hmm.. no..
you can delete only one row of dataset with this method.
i think we have method name that confuses developers..

Navigation

[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod