Publishing Newsletter Using PHP & MySQL

by Amrit Hallan
Byteswoth.com
Thursday, 18th August 2005
Are you tired of using third-party tools to send out routine notifications and emails to your clients? Or, do you want to send your newsletters with individual names of people in the beginning. This series of articles helps you achieve this.

In the first article, you'll learn to create an online subscription form that stores names and emails of people who want to receive your newsletter.

If you are hosting your website on a server that supports PHP and MySQL, through your control panel, you can access an area where you can create either a new database if it doesn't exist, or create a new database. Most servers have the phpMyAdmin interface that lets you create and maintain database without having to learn MySQL commands. Even if you can't make sense of the interface, try to locate a section that allows you to run SQL commands. Run the following command to create the new database:

CREATE DATABASE database_name

In place of "database_name", use the name of your choice. In this case, I'll use "newslet" so that we have:

CREATE DATABASE newslet

A single database can have many tables. Tables are logical structures that contain the rows and columns that store the data. Once our database is created, use the following command to create the table "subscribers":

CREATE TABLE subscribers (
   s_name TEXT NOT NULL,
   s_email VARCHAR(255) UNIQUE NOT NULL)

This command creates the table with fields "s_name" (name of the subscriber) and "s_email" (email of the subscriber). We make the email field unique so that we don't accept the same email again and again.

So our database is crisp ready to be used. In my next article, I'll tell you how to create an online form that accepts name and email, perform a bit of validation, and then store the details into the database.


Options:
Printer Friendly
Email Friend

About The Author:

Amrit Hallan is a freelance web designer. For all web site development and web promotion needs, you can get in touch with him at amrit@bytesworth.com . For further details, visit http://www.bytesworth.com You can subscribe to his newsletter [BYTESWORTH REACHOUT] on Web Designing Tips & Tricks by sending a blank email at bytesworth-subscribe@topica.com.

Developer Categories



Developer Tutorials
ASP
CGI & Perl
CSS
Flash
HTML
Java
JavaScript
MySQL
PHP
Python
XML

Developer Documentation

Developer Tools



Search our Developer Tutorials
  The DevSyndicate Network