mota77 Posted October 24, 2006 at 01:14 PM Report Share #59785 Posted October 24, 2006 at 01:14 PM Boas eu percisava de saber como consigo ver os dados de uma tabela so do proprio mes ando a bater mal já Link to comment Share on other sites More sharing options...
Ped@ntilva Posted October 24, 2006 at 03:11 PM Report Share #59801 Posted October 24, 2006 at 03:11 PM Para isso tens de dizer como está gravado na BD. Link to comment Share on other sites More sharing options...
mota77 Posted October 24, 2006 at 03:56 PM Author Report Share #59806 Posted October 24, 2006 at 03:56 PM dia/mes/ano Link to comment Share on other sites More sharing options...
Ped@ntilva Posted October 24, 2006 at 05:48 PM Report Share #59819 Posted October 24, 2006 at 05:48 PM Para isso tens de fazer uma query deste género: $query = "SELECT * FROM tabela WHERE campo LIKE '%/$mes/%'"; Link to comment Share on other sites More sharing options...
karva Posted October 24, 2006 at 06:21 PM Report Share #59828 Posted October 24, 2006 at 06:21 PM depois de tirares o tempo, usas a funcao date com a segiuinte sintaxe: $data = date(); $mes = date ("m", $data); $query = "SELECT * FROM tabela ORDER BY mes WHERE mes LIKE '%$mes%'"; Proud LEIC-A@IST student! Link to comment Share on other sites More sharing options...
mota77 Posted October 24, 2006 at 06:23 PM Author Report Share #59829 Posted October 24, 2006 at 06:23 PM nao é mais simples usar $data = date(m/Y); SELECT * FROM material WHERE data LIKE '%$data%' Link to comment Share on other sites More sharing options...
karva Posted October 24, 2006 at 06:24 PM Report Share #59830 Posted October 24, 2006 at 06:24 PM pois, mas tu nao queres so dum mes? assim tb mostrar o ano Proud LEIC-A@IST student! Link to comment Share on other sites More sharing options...
mota77 Posted October 24, 2006 at 06:40 PM Author Report Share #59833 Posted October 24, 2006 at 06:40 PM claro olha é o mes do ano!!! eu na base de dados ja tenho desde de 2004 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now