Using a database

He has: 21 posts

Joined: May 2006

What are things that need a database when you have a simple website? What kinds of things can you do with a db over not having one. I am moving the site to a new host and didn't use one before.

Be easy on me, older man learning. Smiling

John

BTW MySQL is setup and available.

demonhale's picture

He has: 3,278 posts

Joined: May 2005

Forums like this one uses db(database) MySql is a form of software that manages these db fast and secure... Old websites that use some form of CMS(Content Management System) or Blogs(web log) use flatfile or a simple text file for storing information like a simple database, it was slow so db's are now used to store these information. MySql is the popular version, if you plan to use some kind of CMS or blog, user systems like membership and some kind of data management, a db or sql option on a host is good...

Some programs you install like this forum, automatically installs db for you or has minimum installation from users, so dont worry, you will know when you will need the feature...

Busy's picture

He has: 6,151 posts

Joined: May 2001

Some basic things you can do with a database:

A counter
Member registration
- newsletter
- private sections
- birthday greetings
- etc
Less html pages; page content can be drawn from the database so you could run a whole site on one page, where as a static html paged site could be lots of pages (oddles of them even Wink muhaha)
Forums
Message boards
CMS and blogs etc as mentioned by demonhale

He has: 21 posts

Joined: May 2006

Thanks for the replies, I revamped my auto club site and installed phpBB, and Coppermine (for photos), both into the db. I had some small glitches, and got them fixed pretty quickly from their site forum members. They both work, that is good, but I don't have more than a base line understanding of a db does. I know it's like a pantry, and can goods go here, plates cups and saucers over here, sugar coffee flour over there, but I have no idea on how to enter or use any information that would be stored there.

I took over webmaster duties of my son's karate school, and one of my counties political site because no-one was doing anything with them. Both of those are used more for announcements, event photos etc. I just checked the karate school is loaded with photos and is using 110 out of 6000 mb, the party site 12 out of 5000. Both are very small.

I am using off site counters for the page hits, are those good enough or is an onsite counter better?

I had thought about private sections, but don't know if there would be enough use to make it worth while. If I did a log on, could members contribute or upload info to a storage area that could be in turn loaded on the site pages? or if I set up a sub domain for one of the candidates would he/she be able to access their own area or would they have to have site ftp access?

Man, It is so much to know and so little time. I have an additional problem. I am running a 240 volt system on 110 volts. I suffer brown out all the time, you know, the lights are on but nobodys at home. Roll eyes

John

Busy's picture

He has: 6,151 posts

Joined: May 2001

Brown outs - ewwww they nasty, get a really good surge protector as you probably know, brown outs are more dangerous.

A lot of stuff you mentioned could be done via the database but doesn't have to be, like the old saying; just because you can doesnt mean you should.
The counter for example, not doubt your off site counter has some stats with it, if you knew the things you wanted you could code it yourself but then why reinvent the wheel.
A lot of premade scripts can be found at places like hotscripts.com but do remember that saying; "just because you can doesn't mean you should"

The phpbb and I believe coppermine have member sections (if on same site). the members could do whatever you allowed them to do, normally just like on here, members can post, edit etc when logged in, can upload profile pictures and attachments on questions etc

Databases are good and can save a lot of time, but with every good side there is a bad side, bad side is they use more server resources, sites like google wouldn't be able to run without a database but they have their own servers, you no doubt are on shared servers like the rest of us

He has: 21 posts

Joined: May 2006

Busy, I tend to mix things too much. The site that I am asking help for is the political party site. It has nothing but html and photos.

My auto club, has the php & Coppermine, and it is working fine.

Thanks for the reality check.

Whats your EZHTML about?

John

demonhale's picture

He has: 3,278 posts

Joined: May 2005

You could actually try and install those PHP scripts on other folders on your site so you can test it, its membership functions, etc. One pain also with dbs are backing-up... although theres a tool for backing up available on a server, you just cant quickly FTP them... Anyways good luck on your sites!

About your last problem on your voltage, there are high-wattage step-up transformers available on the market, a step-up tran can increase a regular 110 outlet to a 220 although not really a clean source, but prevents your stuff from shutting down...
Its not actually a brownout but a result of low-voltage source that causes your system to shutdown...

He has: 21 posts

Joined: May 2006

demonhale wrote: You could actually try and install those PHP scripts on other folders on your site so you can test it, its membership functions, etc. One pain also with dbs are backing-up... although theres a tool for backing up available on a server, you just cant quickly FTP them... Anyways good luck on your sites!

About your last problem on your voltage, there are high-wattage step-up transformers available on the market, a step-up tran can increase a regular 110 outlet to a 220 although not really a clean source, but prevents your stuff from shutting down...
Its not actually a brownout but a result of low-voltage source that causes your system to shutdown...

Ooops, The voltage thang gotchya, I was refering to the power plant between my ears. Laughing out loud

Maybe leaving the database alone could be the way to go.

John

demonhale's picture

He has: 3,278 posts

Joined: May 2005

Thats not a power plant now is it, just some batteries... You really got me there...

In this light why dont you step-up the voltage then, try and eat peanuts more... just kidding!

He has: 21 posts

Joined: May 2006

You're way too funny dude. Laugh

John

Busy's picture

He has: 6,151 posts

Joined: May 2001

A brown out is a power voltage drop, a black out or spike is a power increase. A sudden decrease can do more damage.

The ezhtml site is just a site Wink
But I can use that for an example since you mention it. That site has no database, is just html pages. It could use a database but isn't needed. I have another site, a funny picture site that is just some thousand images and that uses a database, once it was html pages but soon got sick of editing 1500 pages, now the whole site uses about 4 pages, index, display, recommend and contact, although it could of been done with one.

He has: 21 posts

Joined: May 2006

I'm thinking that might work for the political site. I use the same top banner/side bar template for all pages. I post annoucements, meeting reports with photos, candidates pages, etc. and my route directory gets cluttered. I made a 2006 folder and started moving some pages there, and then the graphics/buttons disappeared on the template.

Can I load the template once in the database and and place the meetings in another idirectory for archiving without loosing anything or anything stop working?

John

Busy's picture

He has: 6,151 posts

Joined: May 2001

Don't confuse templates with databases.
If you use the same template for each page an included file would be better than a database:

<?php
include("headsection.php");
include(
"navigation.php");
?>

content
<?php
include("footer.php");
?>

Really a database site (page) delivers different content per view. Lets say your candidates pages have 10 candidates, if each page is just a who is type thing then an html page would be better suited but if the person has their life story on their and is searchable then a database may be a better option.
When I first learnt how to do databases I made everything have one, then realiased it was being silly, so now it only gets a database if it really needs it and one of the minor requirements is the content has to be searchable.

He has: 21 posts

Joined: May 2006

Thanks busy, I will include a link to the site http://granvillegop.org and maybe you can look at it and advise if that suggestion will work.

thanks

John

Busy's picture

He has: 6,151 posts

Joined: May 2001

Personally I think that site would probably be better with just html pages like you have it. Most of the links are to external sites, most of the content is short and sweet and apart from the news and upcoming events not much would be changing.

Databases do have their downsides, this is a good example, with databases you could run the whole site off one page, could be index.php?page=news or id=1, some search engines don't like the ? in the link, and it also makes the link longer, index.php?page=news or news.html. You can use mod_rewrite to make the url more search engine friendly like, index/news/ or just /news/ but this is more resources (you wouldn't notice it on small site like this), just having the topic name can be better for the search engine with as little fuss as possible.

That example I gave you a post or two above about the includes would work well with this site, a page could look like this:

<?php
include("headsection.php"); // the html, head, body tags and top navigation bar
?>

<?php
include("side_navigation.php"); // has the side section
?>

content of the page

<?php
include("footer.php"); // the copyright and counter etc
?>

the files would be:
headsection.php

page title

the top section with logo, banner and top links

side_navigation.php
can be done with a list or table like above, if a table just be sure to start and end it in this page, nothing else goes in here

footer.php
2006 Republican Party of Granville County, NC
Website questions or comments? Email the webmaster
Last Updated 05/01/06
StatCounter

Notice the main page has a table in it and each included file is it's own thing, so if one part was lost or forgotten the site wont fall apart, will just be missing that section.
It's just to give you an idea, even this may be to much for this site as you only have about 12 (main) pages

He has: 21 posts

Joined: May 2006

Thanks busy, I think I may have solved my archive concern. As long as I was using the the page template in the root all of the buttons would show, but placed in an archive (2006)for year folder the red and blue buttons disappeared. By adding / in front of Images in the link they now work.

I will save your suggestion and give it a try.

John

They have: 1 posts

Joined: Aug 2008

good morning sir / maam, i would like to ask a question on how to save database when brownout? our system has connected at the internet it has a time, to save there time in database during brownout. can you give me a good for that? we are using visual basic 6.0 and also MySQL... thank you and god bless you..

They have: 1 posts

Joined: Nov 2008

Web development uses program scripts to connect forms, that people can complete online, to powerful database facilities.Database Design and Implementation methods on our SQL database designs.This ensures that more kinds of information can be stored in the future and avoids duplicated information a major source of errors in poorly designed databases.
-------------------------------------------------------
cynthia jacquline

Search Engine Marketing

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.