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); }
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); }
function getTable($table, $where, $orderBy) { $sql = "SELECT * FROM " . $table . " "; if ($where !== "") { $sql .= " WHERE " . $where . " "; } if ($orderBy !== "") { $sql .= " ORDER BY " . $orderBy . " "; } return executeReader($sql); }
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; }