Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

dataset: delete row with condition AND relation

Started by huyhoang08, March 17, 2016, 01:46:05 AM

Previous topic - Next topic

huyhoang08

i see dataset API:

$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?


abolabo

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

$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

huyhoang08

for example, i can use this:

$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?

abolabo

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

Forum Rules Code of conduct
AbanteCart.com 2010 -