Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Basi di dati ~ informatica triennale > Progetto Basi 2011/2012 Thread Rating: 1 votes, 4.00 average.
Pages (12): « First ... « 8 9 10 11 [12]   Last Thread   Next Thread
Author
Thread    Post New Thread    Post A Reply
gz706450
.novellino.

User info:
Registered: Oct 2008
Posts: 6 (0.00 al dì)
Location:
Corso:
Anno:
Time Online: 15:21:06: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

come avete risolto il fatto che i criteri di selezione devono poter essere combinati fra loro, cioe` che sia possibile filtrare gli annunci in base al numero locali e contemporaneamente alla metratura e/o alla citta` di interesse??

12-10-2012 10:25
Click Here to See the Profile for gz706450 Click here to Send gz706450 a Private Message Find more posts by gz706450 Add gz706450 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
mauro21
.primate.

User info:
Registered: Mar 2009
Posts: 73 (0.01 al dì)
Location: Buccinasco
Corso: Informatica
Anno: Laureato
Time Online: 3 Days, 14:23:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

alla fine la parte sui cluster per distanza l'ho risolta implementando l'algoritmo k-means (casino!!!!)

x i criteri di selezione combinati in pratica ho aggiunto dal php dei pezzi alla query sql

Mi spiego meglio:

la query base è questa

$query= " SELECT i.`Id-Immobile`, a.`Titolo`, a.`Descrizione`, a.`Contratto`,a.`Data_Pubblicazione`, a.`Data_Scadenza`, i.`Citta`, i.`Indirizzo`, i.`Metratura`,i.`Num_Locali`, c.`Nome_Categoria`, a.`Prezzo`, u.`Mail`
FROM Immobile i, Annuncio a, Utente u, Categoria c
WHERE i.`Id-Immobile` = a.`Id-Immobile` AND u.`Id-Utente`=a.`Id-Utente` AND i.`Id-Categoria` = c.`Id-Categoria` AND
CURDATE() between a.`Data_Pubblicazione` AND a.`Data_Scadenza`";

e poi, se x esempio viene selezionato come criterio prezzo (es prezzo<1000), aggiungo alla stringa della query un'altra stringa (in questo caso la stringa $uno, dove $segno è <,> o = e $prezzo è il prezzo inserito)

if ($prezzo!=0){
$uno=" AND a.`Prezzo` $segno $prezzo ";
$query=$query.$uno;
}

spero di esser stato chiaro

12-10-2012 11:35
Click Here to See the Profile for mauro21 Click here to Send mauro21 a Private Message Visit mauro21's homepage! Find more posts by mauro21 Add mauro21 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 03:00.    Post New Thread    Post A Reply
Pages (12): « First ... « 8 9 10 11 [12]   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.030 seconds (72.25% PHP - 27.75% MySQL) con 24 query.