Last updated: Tue, Oct 31, 2023 1:43 pm
Return to Knowledgebase
# | Parameter | Data Type | Required | Description |
---|---|---|---|---|
1 | $table | string | Yes | Name of database table to delete records from. |
2 | $where | array | Yes | Associative array representing the condition(s) to identify the records to be deleted. |
// Condition Array:
// [ Column name, Type of comparison, Values]
// Deleting records from the 'users' table where the 'id' is 5
$result = $db->delete('users', ["id", "=", 5]);
// more examples or condition arrays
["username", "LIKE", "a{3bc1fe685386cc4c3ab89a3f76566d8931e181ad17f08aed9ad73b30bf28114d}"]
["custom5", "IS NULL"]
["logins", "BETWEEN", 10, 30]
["permissions", "IN", [1,2]]