Queries::getWhere PHP Method

getWhere() public method

public getWhere ( $table, $where )
    public function getWhere($table, $where)
    {
        $data = $this->_db->get($table, $where);
        return $data->results();
    }

Usage Example

Example #1
0
	    <div class="checkbox">
		  <label>
		    <input type="checkbox" name="user_avatars" value="1"> Allow custom user avatars
		  </label>
            </div>
            <hr>
	    <input type="submit" class="btn btn-primary" value="Submit">
	  </form>
	  <?php 
                    } else {
                        if ($step === "account") {
                            if (!isset($queries)) {
                                $queries = new Queries();
                                // Initialise queries
                            }
                            $allow_mcnames = $queries->getWhere("settings", array("name", "=", "displaynames"));
                            $allow_mcnames = $allow_mcnames[0]->value;
                            // Can the user register with a non-Minecraft username?
                            if (Input::exists()) {
                                $validate = new Validate();
                                $data = array('email' => array('required' => true, 'min' => 2, 'max' => 64), 'password' => array('required' => true, 'min' => 6, 'max' => 64), 'password_again' => array('required' => true, 'matches' => 'password'));
                                if ($allow_mcnames === "false") {
                                    // Custom usernames are disabled
                                    $data['username'] = array('min' => 2, 'max' => 20, 'isvalid' => true);
                                } else {
                                    // Custom usernames are enabled
                                    $data['username'] = array('min' => 2, 'max' => 20);
                                    $data['mcname'] = array('min' => 2, 'max' => 20, 'isvalid' => true);
                                }
                                $validation = $validate->check($_POST, $data);
                                // validate
All Usage Examples Of Queries::getWhere