/**
  * Returns the data for one table
  *
  * @access   public
  *
  * @param    AbstractDB  $db                 db identifier
  * @param    String      $table              table name
  * @param    Integer     $type               ANYDB_DUMP_ constants
  * @param    String      $seperator          for csv files
  *
  * @returns  Array       the table data
  */
 function getTableData(&$db, $table, $type = ANYDB_DUMP_SQL, $seperator = "\t")
 {
     $res = '';
     $first = true;
     // get all the data
     $query = "SELECT * FROM {$table}";
     $db->query($query, ANYDB_RES_ASSOC);
     while ($line = $db->getNext()) {
         $line = $db->escapeStr($line);
         switch ($type) {
             case ANYDB_DUMP_SQL:
                 $res .= QueryHelper::insert($table, $line) . ";\n";
                 break;
             case ANYDB_DUMP_CSV:
                 if ($first) {
                     $res .= implode($seperator, array_keys($line)) . "\n";
                     $first = false;
                 }
                 $res .= implode($seperator, $line) . "\n";
                 break;
         }
     }
     return $res;
 }
Beispiel #2
0
 public static function getAll()
 {
     return parent::query("SELECT * FROM tekma" . " ORDER BY datum DESC");
 }
Beispiel #3
0
 public static function getAll()
 {
     return parent::query("SELECT *" . " FROM posta" . " ORDER BY id ASC");
 }
Beispiel #4
0
 public static function getUserAllCancelled($uporabnik_id)
 {
     // ---- vsa obdelana in stornirana narocila uporabnika -----
     $orders = parent::query("SELECT *" . " FROM narocilo" . " WHERE uporabnik_id = :uporabnik_id AND obdelano = 'da' AND potrjeno = 'st'", $uporabnik_id);
     return $orders;
 }
Beispiel #5
0
 public static function getAll()
 {
     return parent::query("SELECT * FROM igralec" . " ORDER BY id ASC");
 }
Beispiel #6
0
 public static function getAll()
 {
     return parent::query("SELECT *" . " FROM akcija");
 }
 /**
 * Returns the number of elements in a column
 *
 * @access   public
 * @static
 *
 * @param    AbstractDB  $db                 db resource
 * @param    String      $tableName          table
 *
 * @returns  Integer     value
 */
 function getCount(&$db, $tableName)
 {
     $db->query("SELECT count(*) FROM {$tableName}");
     return $db->getValue();
 }
Beispiel #8
0
 public static function preveriUpodabniskoImeDodajanje($uime)
 {
     $result = parent::query("SELECT COUNT(id)" . "FROM uporabnik WHERE uporabnisko_ime = :uporabnisko_ime", ["uporabnisko_ime" => $uime]);
     return $result[0]["COUNT(id)"] == '0';
 }
Beispiel #9
0
 public static function getAll()
 {
     return parent::query("SELECT id, ime, slika" . " FROM slika");
 }
Beispiel #10
0
 public static function getAll()
 {
     return parent::query("SELECT * FROM uporabnik" . " ORDER BY id ASC");
 }