|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Feb 2002
Città: Modena
Messaggi: 364
|
[PHP+MYSQL] Agenda con evento in scadenza
Salve, premetto che sono alle prima armi con php e mysql.
Sto realizzando un sito internet dove il cliente inserisce una serie di appuntamenti tipo agenda. Ho realizzato già il DB e ho la pagina con tutti gli appuntamenti ordinati per data. Ma avrei bisogno di mostrare quello in scadenza in home page, ma solo quello in scadenza. Qualcuno può aiutarmi? Grazie
__________________
CASE Thermaltake S100 TG Micro Tower Black Alimentatore Itek BS650 EVO 650W - CPU Ryzen 5 5600X - MOBO ASUS TUF Gaming B550M PLUS Wifi II - VIDEO MSI Radeon RX 6750 XT MECH 2X 12G OC - RAM Crucial 2*16GB DDR4 PRO - STORAGE SK hynix Platinum P41 1TB PCIe NVMe Gen4 M.2 2280 |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Jul 2007
Messaggi: 1092
|
Il campo è di tipo datetime suppongo.
Se è così basta che estrai i record con data/ora maggiori di adesso in ordine crescente limitandomi al primo record. Codice:
select * from tabella where campo_datetime > now() order by campo_datetime limit 1 |
|
|
|
|
|
#3 | |
|
Senior Member
Iscritto dal: Feb 2002
Città: Modena
Messaggi: 364
|
Ho fatto così:
Quote:
__________________
CASE Thermaltake S100 TG Micro Tower Black Alimentatore Itek BS650 EVO 650W - CPU Ryzen 5 5600X - MOBO ASUS TUF Gaming B550M PLUS Wifi II - VIDEO MSI Radeon RX 6750 XT MECH 2X 12G OC - RAM Crucial 2*16GB DDR4 PRO - STORAGE SK hynix Platinum P41 1TB PCIe NVMe Gen4 M.2 2280 |
|
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Jul 2007
Messaggi: 1092
|
Prego. Comunque puoi anche fare a meno di anteporre il nome della tabella a quello del campo.
Codice:
SELECT * FROM agenda WHERE `data` > now() ORDER BY `data` limit 1 |
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: Feb 2002
Città: Modena
Messaggi: 364
|
E con questo ti devo una birra
__________________
CASE Thermaltake S100 TG Micro Tower Black Alimentatore Itek BS650 EVO 650W - CPU Ryzen 5 5600X - MOBO ASUS TUF Gaming B550M PLUS Wifi II - VIDEO MSI Radeon RX 6750 XT MECH 2X 12G OC - RAM Crucial 2*16GB DDR4 PRO - STORAGE SK hynix Platinum P41 1TB PCIe NVMe Gen4 M.2 2280 |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:57.



















