/R-CRUD

Rusher CRUD ( PHP )

Primary LanguagePHPMIT LicenseMIT

R-CRUD

Rusher CRUD ( PHP )

Simple Use

Include this plugins

include('r-crud.php');

Create variable function

$func = New r_crud($connection);

How to create data

$table = 'table';
$data = [
    "column1" => $value1,
    "column2" => $value2,
    "column3" => $value3
];
$func->data_create($table, $data);

How to read data

$table = 'table';
$raw_data = $func->data_read_all($table);

foreach($raw_data as $id => $data) {

  echo $id . " -> " . $data['column'];

}

How to read data by "WHERE" query

$table = 'table';
$where = [
    "id" => 1
];
$data = $func->data_read_where($table, $where);
echo $data['column'];

How to update data

$table = 'table';
$where = [
    "id" => 1
];
$data_update = [
  'column1' => $value1,
  'column2' => $value2
];
$func->data_update($table, $data_update, $where);

How to delete data

$table = 'table';
$where = [
    "id" => 1
];
$func->data_delete($table, $where);