AbanteCart Community

AbanteCart Development => API Development => Topic started by: huyhoang08 on March 17, 2016, 01:46:05 AM

Title: dataset: delete row with condition AND relation
Post by: huyhoang08 on March 17, 2016, 01:46:05 AM
i see dataset API:
Code: [Select]
$db=new ADataset('name','key');
//compare single field
$db->deleteRows(array('column_name' => 'field1',  'operator' => '=',  'value' => $value));
So i want to combine 2 fields with AND/OR relation. how to do this?
Title: Re: dataset: delete row with condition AND relation
Post by: huyhoang08 on March 18, 2016, 09:38:08 PM
please help me?
Title: Re: dataset: delete row with condition AND relation
Post by: abolabo on March 21, 2016, 08:07:40 AM
i see dataset API:
Code: [Select]
$db=new ADataset('name','key');
//compare single field
$db->deleteRows(array('column_name' => 'field1',  'operator' => '=',  'value' => $value));
So i want to combine 2 fields with AND/OR relation. how to do this?

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

Title: Re: dataset: delete row with condition AND relation
Post by: huyhoang08 on March 21, 2016, 10:13:55 AM
for example, i can use this:
Code: [Select]
$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
));
I can do this?
Title: Re: dataset: delete row with condition AND relation
Post by: abolabo on March 21, 2016, 11:52:58 AM
hmm.. no..
you can delete only one row of dataset with this method.
i think we have method name that confuses developers..