DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login

Write a script that would allow me to post text at two different times of the day

By: rekha singh | 13 Mar 2010 12:48 pm

Hello everyone!

I am interested in learning and hope I can find help with a project I am working on at this very moment. I want to create a daily devotion for our church ministry website. I need to write a script that would allow me to post text at two different times of the day for every day of the year. The content is text and I have content for every day of the year. Putting the text in will be a colossal job in itself. Could someone point me in the right direction. I am not neccesarily asking for someone to write the code for me, I am willing to work that out on my own but just need someone to guide me through the process. Thanks for any help or suggestions you may have.

Comments

This is fairly simple to do. When you structure your database, you might add columns (or even) tables that associate your content by day, month, year, and the time range during which you want the content to appear. Your scripts can query based on the time ranges. For example if you are using AM and a PM content, your script might check the hour of the day, or even which Meridian is current. The date() function will help a lot with this. Then look up your content and retrieve based on that criteria.

First, your scripts need to establish your database connection.

Then your query might look something like this:

"SELECT content WHERE year = "09" and month = "1" and day = "1" and time =
"am"

This would be assuming columns in a table like -
year
month
day
time
content

Once you have retrieved the array of data for a given time, then it is a matter of printing it in the proper place in your document.

With your permission, I will contact you off-board, so you can ask questions directly. I'd be willing to coach you through this.

By: rekha singh | 13 Mar 2010

You may also check out a CMS like Joomla, Drupal or Wordpress for the same, which can serve your requirements fairly easily.

Though, as you are a starter, scratch coding is recommended to learn PHP in a better way.

Regards,

By: rekha singh | 13 Mar 2010

Don't know how much you want to learn beyond your current task, but I'd recommend these two books:

PHP & MySQL For Dummies 3rd edition (For Dummies (Computer/Tech) )
PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide

I'd start with Dummies series and move to the QuickPro Guide once you have some basics down.

By: rekha singh | 13 Mar 2010

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move