/** * Deletes a row from a table * @param string $tableName * @param array $search */ private function delete($tableName, $search) { $select = new eDB_Select(); $rowID = $select->getRowIdBySearch($search, $tableName); $content = $select->search($tableName, '*'); unset($content[$rowID - 1]); $cols = $select->getColumns($tableName); $completeContent[] = $cols; foreach ($content as $row) { $completeContent[] = $row; } $update = new eDB_Update(); $update->updateTable($completeContent, $tableName); }
/** * Peform an update * @param array $values * @param array $search * @param string $tableName */ private function update($values, $search, $tableName) { $select = new eDB_Select(); $rowID = $select->getRowIdBySearch($search, $tableName); $ChangedRow = $select->getRowById($rowID, $tableName); foreach ($values as $col => $value) { $ChangedRow[0][$col] = $value; } $cols = $select->getColumns($tableName, true); $content = $select->search($tableName, '*'); $completeContent[] = $cols; foreach ($content as $row) { $completeContent[] = $row; } $completeContent[$rowID] = $ChangedRow[0]; $this->updateTable($completeContent, $tableName); }