WebReference.com logo
tip archive  •   about  •   sitemap  •   contact  •   jobs  •   write for us  •   subscribe


[next]

User Personalization with PHP:
Beginning the Application

By

Social Bookmark

UNIX System Administrator - SUN Solaris, Veritas, EMC, Shell Scripting, SAN (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume


In this tutorial we will build an online bookmark system. This will be used to create a database for storing all our URL's and their descriptions. There are many commercial and non-commercial applications that offer almost the exact functionality that we will create in our application; the difference is that we have full control over our application, allowing us to tweak it to suit our needs.

Functional Requirements

So what do we want this application to do?

When we translate these requirements programmatically, we have the following:

The Database

All the information about the user and their bookmarks will be stored in two tables; one will be called 'users' and the other 'bmarks'. Because one user can have many bookmarks, we need to find a way to link information stored in the bookmarks table to a user in the users table. The tables will be created out as follows:

Bookmarks table

Field Description
bid Primary key assigns unique number for every bookmark
uid Links the bookmark to a user in the users table
URL The URL
desc Description of the URL

Users table

Field Description
uid Assigns unique number  to user
uname Stores the user name
upass Stores the password
email Stores the email address of the user
level Saves the access level of the user
bgc Stores the color scheme of the user
img Stores the image of the user

We will store the user id as a foreign key to represent the user in the bookmark table. Then, each time a particular user stores a bookmark, their userID is going to be stored in the bookmarks table as well. This will make it easy to retrieve their bookmarks when we run queries. I've also included some sample data which we will be using throughout this series. To set up the main database, you will need to create a database called 'personalization' and then run the SQL code below. Simply copy and paste it into your MySQL client:

At a later stage we will need to make some changes to the current tables, but for now the database is complete.


[next]

Recent Articles

WebReference.com site name
Use Web Caching to Make Your Web Site Faster
Creating an Online Shopping Cart Mechanism in PHP
Log JavaScript Errors Using an AJAX-driven Web Service
internet.com site name
Configuring Granular Settings for a Database Level Audit
The Perils of a Web 2.0 Transition on Your Business Processes
Facebook Redesigns Site —Again — Nears 400M Mark



The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers