Baabu Posted March 9, 2008 Share Posted March 9, 2008 create table Charger( cid int not null auto_increment, trademark varchar(20) not null, type varchar(30) not null, model varchar(30) not null, unitprice int not null primary key(cid)); well here is my sql for i want to view the entries which are made accroding to the date and the date format should be either view by date or view by month any ideas wat should i add to this table like which format of date and how to view it either by Group by or some other function? Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/ Share on other sites More sharing options...
Stooney Posted March 9, 2008 Share Posted March 9, 2008 That's a very confusing run-on sentence. Could you elaborate a bit and explain what you need? Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487534 Share on other sites More sharing options...
azfar siddiqui Posted March 9, 2008 Share Posted March 9, 2008 I agree with chris:) Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487543 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 well as according to the table if it has records in this format how should i know or how should i add a button to my web page that view all the entires which were made on 21-12-2007 or what entries were made in 2 month just like this :'( Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487561 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 can anyone help me on this the output should be like 2-12-2007 The total Quantity on 2-12-2007 was quantity just like this Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487720 Share on other sites More sharing options...
AndyB Posted March 9, 2008 Share Posted March 9, 2008 The table definition you gave does not have a field in which a date would be stored, so there's no hope of sorting anything/selecting anything based on a date criterion. Add a field to your db-table. Set the type to date - that will default to the ISO standard date format of yyyy-mm-dd. That's good as it allows you to make comparisons far more readily than any other date format. When you display date information from the database, you can format the displayed date in any manner you want, by using the date() function ... Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487725 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 well how can we use the function date() in our query if suppose we have a table like create table test( datex date ); so can we use if we have some vales of datex $query=select * from table order by date(); or anything like that Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487760 Share on other sites More sharing options...
AndyB Posted March 9, 2008 Share Posted March 9, 2008 SELECT * from db_table ORDER by datex ... datex is the fieldname, isn't it? That will give you results ordered by date. If you want sub-sets of that then use a typical WHERE syntax in your query and forget the ORDER, i.e. SELECT * from db_table WHERE datex = 'yourdatehere' Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487765 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 well what if i want to view all the entries of the 3 day how should i use in where clause or some other syntax?? Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487802 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 http://en.wikipedia.org/wiki/Full_stop Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487808 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 Well i guess haku with due respect you can look at your self also... Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487821 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 You asked for suggestions, I gave you one. I think you will find that I use periods just fine, as I taught English for five years. Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487824 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 this wasn't the place for using periods you should try back for five years that suggestion needed was regarding dates not periods so look out for your five years:) Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487831 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 I would reply to that if I had any idea what you just said. When you are communicating with text as your medium, punctuation is a necessity so as to get your point across in a manner that people can understand. Especially when you are asking their help. Its impossible to help someone when you don't even know what it is they are asking. Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487833 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 well it is also meaningless to posting a reply to that post which u are unable to understand this is what the way is other then putting a period it is much better to sit a side let the others go for it if they want rather then making the help method useless and always leave a hope for any one who is trying to learn do not tell them to go off the road. Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487840 Share on other sites More sharing options...
haku Posted March 9, 2008 Share Posted March 9, 2008 What? English please. Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487855 Share on other sites More sharing options...
Baabu Posted March 9, 2008 Author Share Posted March 9, 2008 Look out for your FIVE years Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487873 Share on other sites More sharing options...
trq Posted March 9, 2008 Share Posted March 9, 2008 Locked. Leave it out please. Link to comment https://forums.phpfreaks.com/topic/95180-suggestion-needed/#findComment-487874 Share on other sites More sharing options...
Recommended Posts