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 > Tipo enum SQL <-> PHP e Boolean
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
a.pegasoo
.simpatizzante.

User info:
Registered: Oct 2009
Posts: 13 (0.00 al dì)
Location: milano
Corso: Scienze dell'informazione
Anno: fuori corso
Time Online: 11:23:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Tipo enum SQL <-> PHP e Boolean

Nel progetto vi sarà venuta la tentazione di usare variabili tipo ENUM? es. le piattaforme per il videogioco
Dalla teoria o per lo std non si possa utilizzarle , ma occorre creare delle relazioni e quinidi tabelle.
Inolte voi utilizzate le variabili booleane o altro ?
es. le tre tipologie di utente le individuo con il boolean.
Fatemi sapere cosa ne pensate.

23-05-2011 15:42
Click Here to See the Profile for a.pegasoo Click here to Send a.pegasoo a Private Message Find more posts by a.pegasoo Add a.pegasoo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Mi sfugge perché non si possa usare ENUM.
Parli relativo al progetto o in generale?
Perché in generale non si può praticamente farne a meno. Ad esempio sesso (M/F) in una classica tabella utente.
Non mi sognerei mai di fare una tabella sesso(id_sesso, sesso) e mettere id_sesso fk in utente

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

23-05-2011 17:36
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
a.pegasoo
.simpatizzante.

User info:
Registered: Oct 2009
Posts: 13 (0.00 al dì)
Location: milano
Corso: Scienze dell'informazione
Anno: fuori corso
Time Online: 11:23:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Si hai ragione in generale sono fondamentali, infatti in molti esempi a lezione usano questo tipo di dato.
Il dubbio mi è venuto perchè, non ho apporfondito, ma mi sembra macchinoso trattare il dato di tipo enum , con il PHP, se non usare una tabella come la definivi tu.
Ma ripeto non ho malizia con PHP.
Grazie per l'approfondimento.

24-05-2011 17:05
Click Here to See the Profile for a.pegasoo Click here to Send a.pegasoo a Private Message Find more posts by a.pegasoo Add a.pegasoo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
number15
.grande:maestro.

User info:
Registered: Nov 2005
Posts: 652 (0.09 al dì)
Location:
Corso:
Anno:
Time Online: 121 Days, 13:57:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Tranquillo che è semplicissimo in php.
Esempio stupidissimo, tabella utente con enum tipo('A','U','M'):
(pseudocodice)
se tipo = A
stampa 'admin'
altrimenti se tipo = M
stampa 'mod'
altrimenti stampa 'utente'.

Poi in base al tipo di utente stamperai le diverse informazioni relative a quella tipologia di utente.

Fidati, dell'enum non puoi fare a meno e tra l'altro è alla base dell'eliminazione delle gerarchie di generalizzazioni

__________________
Portale segnalazioni marchi-negozi di abbigliamento
http://www.ovojo.com

24-05-2011 21:52
Click Here to See the Profile for number15 Click here to Send number15 a Private Message Find more posts by number15 Add number15 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 13:52.    Post New Thread    Post A Reply
  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.093 seconds (59.26% PHP - 40.74% MySQL) con 26 query.