bano6010 Posted January 23, 2009 Share Posted January 23, 2009 Hello everyone! I am pretty new to php and mysql databases but I am pressing onward and learning! I recently created a new website and want to have the information in a table displayed within the site. I have done some searching around this site and the web but have been unable to find a starting point. The reason for this is to have other people update the database and have the information then displayed on the site, mainly so I don't have to do all the work. I have created a table in my database named "headlines" and have created several fields the way I think they need to be. I also entered one record for testing. Here is the sql script used to create the fields: CREATE TABLE `headlines` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `day_start` VARCHAR(20) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', `date_start` DATE NOT NULL, `time_start` TIME NOT NULL, `day_end` VARCHAR(20) COLLATE latin1_swedish_ci DEFAULT NULL, `date_end` DATE DEFAULT NULL, `time_end` TIME DEFAULT NULL, `location` VARCHAR(20) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', `name` MEDIUMTEXT NOT NULL, `description` LONGTEXT NOT NULL, `archived` INTEGER(1) NOT NULL, PRIMARY KEY (`id`) )ENGINE=MyISAM AUTO_INCREMENT=2 CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci'; I hope to be able to display this: "Friday, January 23rd - Sunday, January 25th - Too Cold To Stink Campout" or this "Tuesday, February 3rd 7:00 p.m. - Bowling Introduction" I want the person updating the database to have to put in a start day, like Tuesday, a start date like "February 3rd" a name like "Bowling Introduction" and a description of the event that will be displayed on another page. Actually if it helps, here is the site with the events formatted they way I want the sql scripts to do it. I just manually typed each in as of now though. http://www.crew356.org. and if you go to http://www.crew356.org/events, you can see the way I want the descriptions formatted and displayed. Again, I have just typed in each entry at this point. So after all that, can anyone give me a starting point to get the accomplished. In the end, my goal is to have a page where someone can login, and update the database with fields right in the site. But right now I just want the site to display the information in the database the way I want and have had no luck getting anything from the database to display. Thanks so much!! Quote Link to comment https://forums.phpfreaks.com/topic/142117-data-output-into-php-webpage/ Share on other sites More sharing options...
revraz Posted January 23, 2009 Share Posted January 23, 2009 If you search around for a MySQL and PHP tutorial, you should see quite a few that will help you here. Also, ditch the day/date/time fields and just use either the mysql datetime stamp or a unix timestamp. Quote Link to comment https://forums.phpfreaks.com/topic/142117-data-output-into-php-webpage/#findComment-744372 Share on other sites More sharing options...
bano6010 Posted January 23, 2009 Author Share Posted January 23, 2009 Thanks, Ill do some more digging to see if I can find something understandable. Just a quick note too, I don't want to drop the day/date/time fields and use the date stamp because the dates and times are all for future events. Using a current time stamp would be of no use unless I don't understand what you said. Quote Link to comment https://forums.phpfreaks.com/topic/142117-data-output-into-php-webpage/#findComment-744405 Share on other sites More sharing options...
revraz Posted January 23, 2009 Share Posted January 23, 2009 Current time stamp is not relevant, you want your Dates and Times stored in a method which lets you access and search properly. It can be current, past, future... really doesn't matter, it's the Format it's stored in that matters. Quote Link to comment https://forums.phpfreaks.com/topic/142117-data-output-into-php-webpage/#findComment-744432 Share on other sites More sharing options...
bano6010 Posted January 23, 2009 Author Share Posted January 23, 2009 Okay, so do I need to add a field for those? How do I format it to use the time stamp? I am just going to delete the start and end time day and date fields. Quote Link to comment https://forums.phpfreaks.com/topic/142117-data-output-into-php-webpage/#findComment-744442 Share on other sites More sharing options...
fenway Posted January 27, 2009 Share Posted January 27, 2009 Just use a DATETIME field. Quote Link to comment https://forums.phpfreaks.com/topic/142117-data-output-into-php-webpage/#findComment-747516 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.