Database Function deleteRow()

function deleteRow(
$table, $ids, $multiple = true
)

Name in Zenario 8

ze\row::delete()

Description

Deletes a row from a table in the database.

If page caching is in use on a site, the cache will be cleared depending on the tables or rows affected.

Where You Can Use It

From Zenario 7.0.0 onwards.

Parameters

$table

The name of a table.

To meet our guidelines this should be one of your own Plugin's tables, as you may not directly modify a table belonging to another Plugin or the core.

$ids

An associative array of keys (column names) to values to be deleted; see Format of $id and $values for Database Functions for details.

 

$multiple

If multiple rows match, should the all be deleted? Defaults to true, but you may wish to set it to false as a safety catch.

Return Value

Returns the results of a mysqli_affected_rows() call.

Notes

Queries will be run against the last database that was connected to. This will be the local database, unless you switch database using a function such as connectGlobalDB() or connectHubDB().

Example

deleteRow(MY_ANIMAL_MANAGER_PREFIX. 'animals', array('name' => 'Chicken'));

Deletes a row from the animals table named "Chicken".