Exemplo n.º 1
0
function getTableSelected($table, $fields, $where, $orderBy)
{
    $sql = "SELECT " . implode(", ", $fields) . " FROM " . $table;
    if ($where !== "") {
        $sql .= " WHERE " . $where . " ";
    }
    if ($orderBy !== "") {
        $sql .= " ORDER BY " . $orderBy . " ";
    }
    return executeReader($sql);
}
Exemplo n.º 2
0
function getTableDistinct($table, $column, $where, $orderBy)
{
    $sql = "SELECT DISTINCT " . $column . " FROM " . $table . " ";
    if ($where !== "") {
        $sql .= " WHERE " . $where . " ";
    }
    if ($orderBy !== "") {
        $sql .= " ORDER BY " . $orderBy . " ";
    }
    return executeReader($sql);
}
Exemplo n.º 3
0
function getTable($table, $where, $orderBy)
{
    $sql = "SELECT * FROM " . $table . " ";
    if ($where !== "") {
        $sql .= " WHERE " . $where . " ";
    }
    if ($orderBy !== "") {
        $sql .= " ORDER BY " . $orderBy . " ";
    }
    return executeReader($sql);
}
Exemplo n.º 4
0
function getNumberGr($table, $where, $orderBy, $limit, $column, $order)
{
    $sql = "SELECT " . $column . " FROM " . $table . " ";
    if ($where !== "") {
        $sql .= " WHERE " . $where . " ";
    }
    if ($orderBy !== "") {
        $sql .= " ORDER BY " . $orderBy . " " . $order;
    }
    if ($limit !== "") {
        $sql .= " LIMIT " . $limit;
    }
    return executeReader($sql);
    //return $sql;
}