Executes a SELECT on $tableName and returns the first column of the first row

@param string $tableName
@param string $column
@param array $where
@return mixed
483162
public function selectValue($tableName, $column, $where = null)
    {
        $stmt = $this->executeSelect($tableName, $column, $where);
        return $stmt->fetchColumn();
    }
1138816
public function update($tableName, array $data, $where = null)
    {
        return $this->pdo->update($tableName, $data, $where);
    }
162780
function select($table, $fields, $where)
	{
		$query = 'SELECT '.$fields.' FROM '.$table.' '.$this->args_compile($where);
//		$query = str_replace('`', '"', $query);
		return $this->get($query);
	}
244711
public static String buildSqlSELECT(String tableName, String[][] columns, String[] whereColumns,
            Object[] whereValues) {
        final String SQL_TEMPLATE_WHERE = "SELECT {1} FROM {0} WHERE {2}";
        final String SQL_TEMPLATE = "SELECT {1} FROM {0}";

        final List<String> WHERE_CLAUSE = new ArrayList<String>();
        if (whereColumns != null && whereValues != null) {
            if (whereColumns.length != whereValues.length) {
                throw new IllegalArgumentException(
                        "Number of whereColumns must be equal to number of whereValues.");
            }
            for (int i = 0; i < whereColumns.length; i++) {
                if (whereValues[i] instanceof ParamExpression) {
                    WHERE_CLAUSE.add("(" + whereColumns[i] + "="
                            + ((ParamExpression) whereValues[i]).getExpression() + ")");
                } else {
                    WHERE_CLAUSE.add("(" + whereColumns[i] + "=?)");
                }
            }
        }

        final List<String> SELECT_COLUMNS = new ArrayList<String>();
        for (String[] colDef : columns) {
            if (colDef.length > 1) {
                SELECT_COLUMNS.add(colDef[0] + " AS " + colDef[1]);
            } else {
                SELECT_COLUMNS.add(colDef[0]);
            }
        }

        String SQL;
        if (WHERE_CLAUSE.size() > 0) {
            SQL = MessageFormat.format(SQL_TEMPLATE_WHERE, tableName,
                    StringUtils.join(SELECT_COLUMNS, ", "),
                    StringUtils.join(WHERE_CLAUSE, " AND "));
        } else {
            SQL = MessageFormat.format(SQL_TEMPLATE, tableName,
                    StringUtils.join(SELECT_COLUMNS, ", "));
        }

        return SQL;
    }
1163409
public function update($table, $data, $where)
     {
         ksort($data);

         $fielDetail = null;

         foreach ($data as $key => $values) {
             $fielDetail .= "`$key`=:$key,";
         }

         $fielDetail = trim($fielDetail, ',');
         $stmt = $this->conn->prepare("UPDATE $table SET $fielDetail WHERE $where ");
         foreach ($data as $key => $values) {
             $stmt->bindValue(":$key", $values);
         }

         return $stmt->execute();
     }
745165
public static function where($column, $value)
    {
        try {
            self::init();
            $query = 'SELECT * FROM ' . self::$modelTable . ' WHERE '. $column. ' = '. $value;
            return new QueryBuilder(self::$connect, $query);

        } catch (\Exception $exception) {
            var_dump($exception->getMessage());
        }
    }
1178724
public function delete($where, $table = null)
    {
        $table = ($table) ?: $this->getTable();
        $sql = $this->getSql();
        $delete = $sql->delete($table);

        $delete->where($where);

        $statement = $sql->prepareStatementForSqlObject($delete);
        $result = $statement->execute();

        return $result->getAffectedRows();
    }
487008
public function where($column, $value = null)
    {
        if (is_array($value)) {
            return $this->whereIn($column, $value);
        }

        if ($column instanceof Closure) {
            return $this->using($column);
        }

        $this->wheres[] = compact('column', 'value');

        return $this;
    }
1276756
protected function whereInSelect(array $where)
    {
        return $this->wrap($where['column']) . ' ' . ($where['not'] ? 'NOT IN ' : 'IN ') . '(' . $this->select($where['subquery']->getSQLStatement()) . ')';
    }
1346448
public function select($columns = '*'): SelectQuery
    {
        return $this->database->select(func_num_args() ? func_get_args() : '*')->from($this->name);
    }
674355
public function whereIn($column, $values, $table = null)
    {
        $table = isset($table)? $table : $this->table;
        $this->whereIn[] = [
            'table' => $table,
            'column' => $column,
            'values' => $values
        ];
        return $this;
    }
137809
public function where($table, $column, $keyword)
    {
        $connection = Connection::connect();

        $selectValue = $connection->prepare('select * from '.$table.' where '.$column.' = \''.$keyword.'\'');
        $selectValue->execute();

        return $selectValue->fetch(PDO::FETCH_ASSOC);
    }
615495
public function findWhere(array $wheres, array $columns = ['*'])
    {
        return $this->mediator->transform($this->mediator(func_get_args()))->first();
    }
1300095
public function executeSelect($tableName, $columns = '*', $where = null, $afterWhere = '')
    {
        return $this->pdo->executeSelect($tableName, $columns, $where, $afterWhere);
    }
281797
public function getBy($column, $value, array $columns = ['*'])
    {
        $result = $this->getBuilder()
                       ->select($columns)
                       ->where($column, '=', $value)
                       ->first();

        // Reset query builder
        $this->resetBuilder();

        return $result;
    }
78694
public function fetchRow(array $where = null, array $column = null, array $order = null)
    {
        $qp = $this->_fetch($where, $column, $order);

        $row = $this->_fetchRow($qp['query'], $qp['params']);
        $className = $this->_rowClass;
        $class = new $className($this);

        if (!$row) {
            return false;
        }

        $class->setData($row);

        return $class;
    }
236894
public function showColumns($table, $where = null)
    {
        $where = $where ? ' WHERE '.$where : null;
        $this->query = 'SHOW FULL COLUMNS FROM `' . $table .'`' . $where;
        return $this;
    }