hi i’m yii user management module & i created data table for my application so when someone insert new data i want to insert his user id Automatically in mt data table how do this
CREATE TABLE IF NOT EXISTS offer_detail (
id int(60) NOT NULL AUTO_INCREMENT,
company_id int(60) NOT NULL,
offertype_id int(60) NOT NULL,
category_id int(60) NOT NULL,
offer_title varchar(150) NOT NULL,
offer_description text NOT NULL,
image varchar(150) NOT NULL,
coupon_id varchar(60) NOT NULL,
price text NOT NULL,
unit_id varchar(10) NOT NULL,
price_now varchar(60) NOT NULL,
from varchar(80) NOT NULL,
to varchar(80) NOT NULL,
[color="#FF0000"]user_id int(60) NOT NULL,[/color]
PRIMARY KEY (id`),
user table (YII user managment modules )
CREATE TABLE IF NOT EXISTS user (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
username varchar(20) NOT NULL,
password varchar(128) NOT NULL,
activationKey varchar(128) NOT NULL DEFAULT ‘’,
createtime int(10) NOT NULL DEFAULT ‘0’,
lastvisit int(10) NOT NULL DEFAULT ‘0’,
lastaction int(10) NOT NULL DEFAULT ‘0’,
lastpasswordchange int(10) NOT NULL DEFAULT ‘0’,
superuser int(1) NOT NULL DEFAULT ‘0’,
status int(1) NOT NULL DEFAULT ‘0’,
avatar varchar(255) DEFAULT NULL,
notifyType enum(‘None’,‘Digest’,‘Instant’,‘Threshold’) DEFAULT ‘Instant’,
PRIMARY KEY (id),
UNIQUE KEY username (username),
KEY status (status),
KEY superuser (superuser)
)
thank you …