![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 141 Pomógł: 0 Dołączył: 9.10.2015 Ostrzeżenie: (0%) ![]() ![]() |
Cześć, w skrypcie używam tej classy https://github.com/joshcam/PHP-MySQLi-Datab...ss#select-query
Moje zapytanie wygląda tak:
Wyświetla wszystkie posty, a chciałbym by je jeszcze sortowało według daty, data posta jest zapisywana w timesamp, a kolumna z datą to "post_date", jak bedzie wyglądać zapytanie z sortowaniem według daty? |
|
|
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
W linku co sam tu podales masz
Cytat More advanced examples: $params = Array(1, 'admin'); $users = $db->rawQuery("SELECT id, firstName, lastName FROM users WHERE id = ? AND login = ?", $params); print_r($users); // contains Array of returned rows // will handle any SQL query $params = Array(10, 1, 10, 11, 2, 10); $q = "( SELECT a FROM t1 WHERE a = ? AND B = ? ORDER BY a LIMIT ? ) UNION ( SELECT a FROM t2 WHERE a = ? AND B = ? ORDER BY a LIMIT ? )"; $resutls = $db->rawQuery ($q, $params); print_r ($results); // contains Array of returned rows edit:: o orderBy juz nie wspominajac.... Cytat Ordering method $db->orderBy("id","asc"); $db->orderBy("login","Desc"); $db->orderBy("RAND ()"); $results = $db->get('users'); Wszystko to nastronie do ktorej sam podales linka... -------------------- "Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista "Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 14.07.2025 - 17:35 |