File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,3 +240,26 @@ img {
240240 background-color : # f5f5f5 ;
241241 }
242242}
243+
244+ .pagination {
245+ ul {
246+ display : flex;
247+ justify-content : space-between;
248+ gap : 5px ;
249+ li {
250+ border : 1px solid # ddd ;
251+ border-radius : 4px ;
252+ padding : 5px ;
253+ margin : 10px 0 ;
254+ box-sizing : border-box;
255+ }
256+ li : first-child ::marker {
257+ content : "← " ;
258+ }
259+ li : last-child ::marker {
260+ content : "→ " ;
261+ }
262+ }
263+
264+
265+ }
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ Zufällige Datensätze auswählen
219219
220220Wie kann man zufällige Datensätze auswählen?
221221
222- <php caption =" Abfrage von zufälligen Datensätzen in einer großen Tabelle " >
222+ <php caption =" Abfrage von 10 zufälligen Datensätzen in einer großen Tabelle " >
223223$query =$dbh->query(
224224 "SELECT * FROM users
225225 TABLESAMPLE BERNOULLI (1)
@@ -232,13 +232,11 @@ $personen = $query->fetchAll(PDO::FETCH_OBJ);
232232
233233Für sehr kleine Tabellen funktioniert diese Methode besser:
234234
235- <php caption =" Abfrage von zufälligen Datensätzen in einer großen Tabelle " >
235+ <php caption =" Abfrage von 3 zufälligen Datensätzen in einer kleinen Tabelle " >
236236$query =$dbh->query(
237237 "SELECT * FROM users
238- TABLESAMPLE BERNOULLI (1)
239- WHERE profile_visible
240- ORDER BY lastname
241- LIMIT 10;"
238+ ORDER BY RANDOM()
239+ LIMIT 3;"
242240);
243241$personen = $query->fetchAll(PDO::FETCH_OBJ);
244242</php >
@@ -255,4 +253,5 @@ Postgres
255253
256254 * [ LIMIT anzahl OFFSET anfangsposition] ( http://www.postgresql.org/docs/current/static/functions-aggregate.html )
257255 * [ COUNT(* )] ( http://www.postgresql.org/docs/8.1/static/queries-limit.html )
256+ * [ RANDOM()] ( https://www.postgresql.org/docs/17/functions-math.html#FUNCTIONS-MATH-RANDOM-TABLE )
258257 * [ TABLESAMPLE] ( http://www.postgresql.org/docs/devel/static/sql-select.html#SQL-FROM )
You can’t perform that action at this time.
0 commit comments