public function query_select($table, $fields = '*', $conditions = '', $options = array(), $fetch_array = false) { $query = 'SELECT ' . $fields . ' FROM ' . $table; if ($conditions != '') { $query .= ' WHERE ' . $conditions; } { $query .= ' ORDER BY ' . $options['order_by']; } { $query .= ' LIMIT ' . $options['limit']; } if (!$fetch_array) { return $this -> pdo -> query($query); } else { $query = $this -> pdo -> query($query); return $this -> fetch_array($query); } } public function fetch_array($query, $fetch_style = PDO::FETCH_BOTH) { { return '<b>Warning: Invalid argument</b>'; } $fetch_array = $query -> fetch($fetch_style); return $fetch_array; }
I teraz zastanawiam się nad tym argumentem: $fetch_array = false jest on potrzebny czy nie?