Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
SQL upit... help...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
i72852



Joined: 25 Feb 2004
Posts: 81

PostPosted: 28.07.2005 20:16    Post subject: SQL upit... help... Add user to your forum ignore list Reply with quote

Dakle imam neku tablicu koja izgleda ovako :

Code:
+----+------+-----+
| id | text | fid |
+----+------+-----+
| 1  | tx1  |  0  |
| 2  | tx2  |  0  |
| 3  | tx3  |  0  |
| 4  | d4   |  2  |
| 5  | d5   |  1  |
| 6  | d6   |  1  |
| 7  | d7   |  3  |
+----+------+-----+


e sad mi treba sql koji ce dati ovo:
Code:
+----+------+
| id | text |
+----+------+
| 3  | tx3  |
| 7  | d7   |
| 2  | tx2  |
| 4  | d4   |
| 1  | tx1  |
| 5  | d5   |
| 6  | d6   |
+----+------+


mucim se vec nekoliko sati i nikako uspjeti... Sad
Back to top
View user's profile Send private message Visit poster's website
Chaby



Joined: 19 Oct 2003
Posts: 132
Location: VG/ Kurilovec

PostPosted: 28.07.2005 20:28    Post subject: Add user to your forum ignore list Reply with quote

Ja ne kužim ni kaj ti tu želiš dobit? Mislim da nekaj želiš sortirat, al' ne znam po čemu, detaljnije malo...
Back to top
View user's profile Send private message
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 28.07.2005 23:19    Post subject: Add user to your forum ignore list Reply with quote

ako sam dobro shvatio zelis imat nekakav parent-child odnos?
znaci da ovi sa fid-om 0 su glavni i sortaju se po id-u DESC i za svaki od njih zelis dobit childove koji imaju fid jednak njihovom id-u. mislim da ces to tesko dobit u jednom queryu.

a ako nisam dobro shvatio i zelis samo random ispisivanje stavi ORDER BY RAND()

:)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
i72852



Joined: 25 Feb 2004
Posts: 81

PostPosted: 29.07.2005 00:00    Post subject: Add user to your forum ignore list Reply with quote

che.UP wrote:
ako sam dobro shvatio zelis imat nekakav parent-child odnos?
znaci da ovi sa fid-om 0 su glavni i sortaju se po id-u DESC i za svaki od njih zelis dobit childove koji imaju fid jednak njihovom id-u.


točno no mi treba... Very Happy
znaci ipak moram s više querya... Sad
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group