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


[next]

User Personalization with PHP:
Beginning the Application

By

Social Bookmark

Head of Settlement Information Technology (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
Building a Banking Application Home Page with OOP
Mixing Scripting Languages
Review: phpFox, a Social Networking CMS with all the Bells and Whistles
internet.com site name
Enterprise 2.0: Social Networking in the Cloud
BroadSoft Marketplace Hastens Pace of Telephony Innovation
Review: HTC Hero for Sprint


internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs