User Management Help Needed

I have the following table in sqlite

CREATE TABLE tbl_users (

user_id integer PRIMARY KEY AUTOINCREMENT NOT NULL,

user_type smallint DEFAULT 0,

user_name varchar(50) NOT NULL,

passWord varchar(50),

firstName varchar(50) NOT NULL,

lastName varchar(50) NOT NULL,

email varchar(50) NOT NULL,

user_registered date,

lastVisitDate date,

activation boolean DEFAULT 0,

block boolean DEFAULT 0,

);

i want to create a total user management system with this table.

the passWord need to be md5 encrypted.

and i will need to use the logged in user_id very often (the user_id in the session variable).

so please let me know how to do that as well.

Take a look at example yii blog article.

Regarding storing of password in the DB, I strongly recommend you read some material on this. Simple MD5 hashing is not a considered a secure option these days. Please refer to this blog post for more information.

I also recommend using phpass extension that gives you the needed functionality ready made.