# responsive-menu/3.0.6/src/app/Database/WpDatabase.php

Responsive Menu – Create Mobile-Friendly Menu, version 3.0.6. 42 lines.

- Page: https://pluginprobe.com/plugins/responsive-menu/3.0.6/code/src/app/Database/WpDatabase.php
- Raw: https://pluginprobe.com/plugins/responsive-menu/3.0.6/raw/src/app/Database/WpDatabase.php
- Modified: 2016-07-09T16:41:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/responsive-menu/3.0.6/code/src/app/Database/WpDatabase.php#L10-L20`.

```php
<?php

namespace ResponsiveMenu\Database;

class WpDatabase implements Database {

  public function __construct() {
    global $wpdb;
    $this->db = $wpdb;
  }

  public function update($table, array $to_update, array $where) {
    $this->db->update($this->db->prefix . $table, $to_update, $where);
  }

  public function delete($table, $name) {
    $this->db->delete($this->db->prefix . $table, $name);
  }

  public function all($table) {
    return $this->db->get_results("SELECT * FROM {$this->db->prefix}{$table}");
  }

  public function insert($table, array $arguments) {
    $arguments['created_at'] = current_time('mysql');
    $this->db->insert($this->db->prefix . $table, $arguments);
  }

  public function select($table, $column, $value) {
    return $this->db->get_results("SELECT * FROM {$this->prexix}{$table} WHERE $column = '$value';");
  }

  public function getPrefix() {
    return $this->db->prefix;
  }

  public function getCharset() {
    return $this->db->get_charset_collate();
  }

}

```
