thread_PHP Posted July 10, 2007 Share Posted July 10, 2007 HI All I have a table like this below CREATE TABLE `newevent` ( `event_id` int(6) unsigned NOT NULL auto_increment, `eventtitle` varchar(40) default NULL, `eventtype` varchar(40) default NULL, `eventdescription` varchar(255) default NULL, `venuename` varchar(40) default NULL, `streetaddress1` varchar(100) default NULL, `streetaddress2` varchar(100) default NULL, `city` varchar(50) default NULL, `state` varchar(40) default NULL, `zipcode` varchar(20) default NULL, `country` varchar(40) default NULL, `startdate` varchar(40) default NULL, `enddate` varchar(40) default NULL, `starttimehh` varchar(40) default NULL, `starttimemm` varchar(40) default NULL, `starttimeam` varchar(40) default NULL, `endtimehh` varchar(40) default NULL, `endtimemm` varchar(40) default NULL, `endtimeam` varchar(40) default NULL, `total` varchar(20) default NULL, `males` varchar(40) default NULL, `females` varchar(40) default NULL, PRIMARY KEY (`event_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; i want to display the value in startdate,enddate with the event exists for example my event runs from startdate 1-july-2007 till 5-july-2007 i want to display my eventtitle till it ends on 5th of July 2007 How can i write this query for example when i write the query to see the select eventtitle,startdate,enddate from newevent is the query that will return the following rows Eventtitle StartDate Enddate 'Social Lunch','Wednesday, June 13, 2007','Saturday, June 30, 2007' 'Social Lunch','Wednesday, June 13, 2007','Saturday, June 30, 2007' 'Social Lunch','Wednesday, June 13, 2007','Saturday, June 30, 2007' 'Social Lunch','Wednesday, June 13, 2007','Saturday, June 30, 2007' 'Social Lunch','Wednesday, June 13, 2007','Saturday, June 30, 2007' 'Social Lunch','Wednesday, June 13, 2007','Saturday, June 30, 2007' so in the above query social lunch is occuring from 13th june till 30th july2007 with the above query i am getting displayed start of event and end of the event i want to display all the dates from 13th june 2007 till 30th july 2007 in the output Anybody please help me Quote Link to comment https://forums.phpfreaks.com/topic/59328-displaying-startdate-and-enddate-from-a-table/ Share on other sites More sharing options...
fenway Posted July 11, 2007 Share Posted July 11, 2007 Don't store the dates as varchars, use proper date fields. Quote Link to comment https://forums.phpfreaks.com/topic/59328-displaying-startdate-and-enddate-from-a-table/#findComment-295388 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.