Author Topic: dataset: delete row with condition AND relation  (Read 8485 times)

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
dataset: delete row with condition AND relation
« 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?

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
Re: dataset: delete row with condition AND relation
« Reply #1 on: March 18, 2016, 09:38:08 PM »
please help me?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2067
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: dataset: delete row with condition AND relation
« Reply #2 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?

“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
Re: dataset: delete row with condition AND relation
« Reply #3 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?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2067
  • Karma: +326/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: dataset: delete row with condition AND relation
« Reply #4 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..
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod