How do we create MYSQL VIEW for all modes View/Add/Edit/Dele

Talk about implementing of customized templates

Moderator: alexandrleonenko

rssridhar17
Junior
Junior
Posts: 21
Joined: Dec 8th, '11, 05:01

How do we create MYSQL VIEW for all modes View/Add/Edit/Dele

Postby rssridhar17 » Jan 23rd, '12, 08:09

Hi Admin,

I have a customer-table where depending on the login user name I am letting the user to add/edit/delete records.
Concurrently there could be any number of users accessing the same table for this operation, so they need to see only their records at any given point, for this I am checking their $_SESSION['user'], based on this validity they need to perform all operations.

For this I thought using MYSQL VIEW would be the best. OR please let me know if there is a better way doing it .

kindly let me know how to define this in the datagrid php file. Will this kind of command work if i define
in Section: 1. Creating & Calling:

Example:
CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition

administrator
Site Admin
Site Admin
Posts: 6003
Joined: Jan 7th, '09, 23:18
Contact:

Re: How do we create MYSQL VIEW for all modes View/Add/Edit/Dele

Postby administrator » Jan 23rd, '12, 10:16

You may prepare VIEW in your database (by yourself) and then use it in datagrid like it was a standard table!

rssridhar17
Junior
Junior
Posts: 21
Joined: Dec 8th, '11, 05:01

Re: How do we create MYSQL VIEW for all modes View/Add/Edit/Dele

Postby rssridhar17 » Jan 23rd, '12, 12:37

Hi Admin,

Thank you for your response !

Without using CREATE VIEW,

I was able to do the same by using $condition=fieldname=$_SESSION['user']; It is working now !


Return to “Add/Edit/View Mode Templates Implementing”