> For the complete documentation index, see [llms.txt](https://sprnva.gitbook.io/sprnva-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sprnva.gitbook.io/sprnva-docs/database/delete.md).

# Delete

This is for the deleting a row in the table. The `$whereParams` is optional only.

```php
// DB()->delete($table, $whereParams = '');

<?php

namespace App\Controllers;

class UserController
{
    public function destroy()
    {
        $user_id = Auth::user('id');
        DB()->delete('users', "id = '$user_id'");
    }
}
```

Always remember that the `delete` method return a integer result, if the result is `1` it is true then `0` is false. False if the query produce an error and true if the query is successfully executed against the database.
