public function wheel($table, $column, $value, $separator = '_', $maxTries = 10)
    {
        $tempValue = $value;

        for ($i = 2; $i <= $maxTries; ++$i) {
            $result = $this->query("select count(*) as cnt from " . $this->quoteSpecialName($table) . " where " . $this->quoteSpecialName($column) . " = '" . $this->real_escape($tempValue) . "' limit 1;", null);

            $row = $result->row();
            if ($row->cnt == 0) {
                return $tempValue;
            }

            $tempValue = $value . $separator . $i;
        }

        throw new \Slab\Database\Exceptions\Query("Failed to wheel value " . $value . " over " . $maxTries . " tries on " . $table . "." . $column);
    }
public function wheel($table, $column, $value, $separator = '_', $maxTries = 10)
    {
        $tempValue = $value;

        for ($i = 2; $i <= $maxTries; ++$i) {
            $result = $this->query("select count(*) as cnt from " . $this->quoteSpecialName($table) . " where " . $this->quoteSpecialName($column) . " = '" . $this->real_escape($tempValue) . "' limit 1;", null);

            $row = $result->row();
            if ($row->cnt == 0) {
                return $tempValue;
            }

            $tempValue = $value . $separator . $i;
        }

        throw new \Slab\Database\Exceptions\Query("Failed to wheel value " . $value . " over " . $maxTries . " tries on " . $table . "." . $column);
    }
public function wheel ( $ table , $ column , $ value , $ separator = '_' , $ maxTries = 10 ) { $ tempValue = $ value ; for ( $ i = 2 ; $ i <= $ maxTries ; ++ $ i ) { $ result = $ this -> query ( "select count(*) as cnt from " . $ this -> quoteSpecialName ( $ table ) . " where " . $ this -> quoteSpecialName ( $ column ) . " = '" . $ this -> real_escape ( $ tempValue ) . "' limit 1;" , null ) ; $ row = $ result -> row ( ) ; if ( $ row -> cnt == 0 ) { return $ tempValue ; } $ tempValue = $ value . $ separator . $ i ; } throw new \ Slab \ Database \ Exceptions \ Query ( "Failed to wheel value " . $ value . " over " . $ maxTries . " tries on " . $ table . "." . $ column ) ; }
"Wheel" a string value in the database

@param $table
@param $column
@param $value
@param string $separator
@param int $maxTries
@return string
@throws \Slab\Database\Exceptions\Query
Wheel a string value in the database