Jump to content

Data output into PHP webpage


bano6010

Recommended Posts

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!!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.