Search code examples
pdonotorm

Delete query with conditions in NotORM


How can I implement the below query using pdo notorm?

mysql_query("DELETE FROM table WHERE (down-up)>=some value AND id=$id");

I know the below statement will delete the selected row with id of value $id. But I am confused on, how can I check the condition, (down-up)>=some value in my delete statement.

$row  = $db->table[$id];

$affected = $row->delete();

Please help me out.


Solution

  • Try this

    $notORM->tablename("id", $id)->where("down-up >= value")->delete();
    

    I haven't tested it, let me know if you have any issues.