Phorum.ro
Your Avatar Welcome to Phorum.ro!
If you haven't registered yet, click here!
Attention Visitor:
You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Du-te înapoi   Phorum.ro > Web Design & Web Development > Programare > PHP > PHP DB

PHP DB Discutii despre lucrul cu baze de date in PHP.

Răspunde
 
Thread Tools Moduri de afișare
Vechi 18.05.2007   #1
edu2005eu
32-Bit Member
 
edu2005eu's Avatar
 
Data înregistrării: 20.03.2006
Vârsta: 20
Mesaje: 45
Rep Power: 7
edu2005eu is on a distinguished road
Question diferenta

Salut!
Imi spune si mie cineva cum pot in MySQL + PHP sa ordonez niste intrari din baza de date dupa diferenta a 2 valori?
De ex daca am:

id | for | against
1 | 4 | 2
2 | 1 | 5
3 | 6 | 1

sa afiseze 3, 1, 2.

Nu stiu daca m`am exprimat destul de clar dar sper sa intelegeti.
__________________
Keep on rockin' people!
edu2005eu is offline   Reply With Quote
Sponsored Links
Vechi 18.05.2007   #2
nchipn
32-Bit Member
 
nchipn's Avatar
 
Data înregistrării: 20.11.2006
Locație: oradea
Mesaje: 195
Rep Power: 6
nchipn is on a distinguished road
Implicit

Deci tu ai vrea sa ordoneze dupa diferenta dintre [against] si [for]?
Incearca asa :
Cod PHP:
SELECT FROM tabel ORDER BY (for-against
Daca nu merge, cel mai simplu e sa pui si o coloana cu difernta .
nchipn is offline   Reply With Quote
Vechi 18.05.2007   #3
edu2005eu
32-Bit Member
 
edu2005eu's Avatar
 
Data înregistrării: 20.03.2006
Vârsta: 20
Mesaje: 45
Rep Power: 7
edu2005eu is on a distinguished road
Implicit

am incercat si nu merge. afiseaza rezultatul ca si cand nu ar fi ordonat...
__________________
Keep on rockin' people!
edu2005eu is offline   Reply With Quote
Răspunde


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Moduri de afișare

Reguli de postare
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Pornit
emoticoanele sunt Pornit
Codul [IMG] este Pornit
Codul HTML este Oprit



Ora este GMT +3. Ora este acum 00:58:39.


Rulează cu: vBulletin Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum SEO by Zoints

XXXXXXXXXXXXXXXXXXX
Inactive Reminders By Icora Web Design