SQL PHP HTML ASP JavaScript articles and free scripts to download

Managing content from admin area using PHP MySQL

Using PHP and MySQL database we will try to develop a content management solution. This is a very basic solution and more features can be added to this script. This script can be a part of any website or can be integrated to any script. This script can be used to post news, jokes, events and many other similar types of contents. Here the site admin ads or posts content from inside the admin area. The admin can select a category and then add title, date, short description and full details of the content. Let us try to learn how the admin area works. But before that let us understand how the table structures are organized in this scripts.

Tables used and there structures

Three tables are used in this script. The main table name is content. To this table admin posts the content by entering title, date, short description and long description. Here for each record one category ID is assigned. Category names are displayed in a drop down list by taking from content_cat table and only the cat_id is stored along with other data for each record in content table. Each record in content table ( after adding ) gets one unique content identification number while the record is added by using auto increment filed property. This we call cont_id and it is used for handling each record in our table.

The table content_cat is used to store category name. Each category once added by admin generates one unique category identification number and we call that cat_id. We used an auto increment field to generate this incremental unique number for each category. This category name gets linked to the content table by cat_id field. Each category name can be edited or added or delete from the content_cat table but while deleting script will check if any record is assigned to this category in main content table. If records are assigned in content table then category name will not be deleted and a message will be displayed. Same way while adding category name the script will check if that name is already existing or not.

We will be using one more table to validation the admin for entering inside the admin area. We will only store admin user id and password in this table and match with the user entered values in the login page. Please note that the password stored is not encrypted.

Here is the dump of all the three tables.

CREATE TABLE `content` (
`cont_id` int(3) NOT NULL auto_increment,
`cat_id` int(3) NOT NULL,
`dt` date NOT NULL,
`title` varchar(250) NOT NULL,
`short_dtl` text,
`dtl` text NOT NULL,
UNIQUE KEY `cont_id` (`cont_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

CREATE TABLE `content_admin` (
`admin_id` varchar(8) NOT NULL,
`admin_pw` varchar(8) NOT NULL,
UNIQUE KEY `admin_id` (`admin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `content_cat` (
`cat_id` int(11) NOT NULL auto_increment,
`name` varchar(250) NOT NULL,
UNIQUE KEY `cat_id` (`cat_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;

how the content management script works



Download the full script here
Google+
fareed19-01-2009
nice tutorial
pankaj choudhary14-03-2009
this is one of the best website for tutorial of php or other web designing languages
Elandirayan26-03-2009
Thanks to plus2net.com for providing the technical details in very short and clear manner.
I hates of for your service.
Thank you once again.
bala25-04-2009
ya thanks for you giving such a wonderful script really this is very useful.
thanks
plus2net
maithili28-04-2009
this site is very useful for me
lily12-02-2010
nice.. helps a lot
Bonny07-04-2011
This script saved me time when I was creating event manager for my church. Much thanks.
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer