A
|
Alan4573 8/16/2006 |
Amir, |
A
|
amirgulamali author 8/16/2006 |
Amir, I have sent you full details by email. Alan
Here are more details: I am making an address book where several users will be entering data. I want only the users who create a particular entry to be able to modify it hence I selected Users can see others data but can edit their own data only Now I also wanted to let ALL users to be able to add comments on ANY records whether that is their record or not so I created a view for the original table and selected Users can see and modify other users data and on step 7 for the view, I let all fields be read only except the COMMENTS field so that users can add comments and read only other details. Now I have 4 other fields (ALL IN TABLE: ADDRESS BOOK) 1.Created by (VISIBLE IN ADDRESS BOOK) 2.Created on (VISIBLE IN ADDRESS BOOK) 3.Last commented by (NOT VISIBLE IN ADDRESS BOOK-BUT VISIBLE IN THE VIEW(which I called COMMENTS PAGE)) 4.Last commented on (NOT VISIBLE IN ADDRESS BOOK-BUT VISIBLE IN THE VIEW(which I called COMMENTS PAGE)) I was able to easily set up 1. and 2. (before emailing you) but see I want set up 3. and 4. everytime a comment is added from the COMMENTS PAGE (which is a view of the ADDRESS BOOK TABLE).. Using events, I was able to add 3. and 4. in the table but for some reason they are entered as new records and not along the same row? Hope you understand my aim, thanks again for your quick response |
A
|
amirgulamali author 8/17/2006 |
I am using this for the COMMENTS PAGE EVENTS (which is a view- not a table) ...
|
A
|
Alan4573 8/17/2006 |
Amir, |
A
|
amirgulamali author 8/17/2006 |
that dint work, anyways i changed my plan and am now loggin "commented by" ""commented on" in another table using this event: function BeforeEdit(&$values, $where)
-- ---------------------------- -- Table structure for address_book -- ---------------------------- CREATE TABLE `address_book` ( `REF` int(20) NOT NULL auto_increment, `Company_Name` varchar(100) default NULL, `Company_Address` varchar(200) default NULL, `Contact_Person` varchar(75) default NULL, `Phone_Number` varchar(75) default NULL, `Email` varchar(20) default NULL, `Activity_with_Employer` varchar(100) default NULL, `Comments` varchar(150) default NULL, `created_by_user` varchar(75) default NULL, `created_on` datetime default NULL, `career_service` varchar(100) default NULL, PRIMARY KEY (`REF`) ) TYPE=MyISAM; -- ---------------------------- -- Table structure for Comments_History -- ---------------------------- CREATE TABLE `Comments_History` ( `id` int(15) NOT NULL auto_increment, `REF` int(20) NOT NULL default '0', `Company_Name` varchar(100) default NULL, `Comments` varchar(250) default NULL, `commented_by` varchar(20) default NULL, `commented_on` datetime default NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM;
|
![]() |
Alexey admin 8/17/2006 |
Amir, |
A
|
amirgulamali author 8/17/2006 |
i realised what caused the error after debugging and trying all sorts of possibilities: |
A
|
amirgulamali author 8/17/2006 |
making my case clear: |
![]() |
Alexey admin 8/18/2006 |
Amir, global $conn; $sql = "select * from mytable where ".$where; $rs=db_query($sql,$conn); $data=db_fetch_array($where); echo $data["MyField"]; |