Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 19th June 2012, 11:19
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 922
Thanks: 16
Thanked 258 Times in 206 Posts
Default Storing form data in more than one db table

I'm just at trying to implement this
http://www.howtoforge.com/forums/showthread.php?t=57628

I want to create separate database and db_user forms - that is no problem.
But to keep things easy for unexperienced users I want to (mainly) maintain the current database editing form and make the new ones optional.
My question is: Is it possible to store information from one form into separate db tables?

To make things clearer:
There are three db tables.
- databases
- database users
- db <-> user link table

When using the current simple database editing form after saving and before displaying the data have to be stored to / read from those three tables.
In the form definition files and server module/plugins I found the possibility to only give one single table.
Theoretically I could store the data in the second / third table by hand, but as far as I can see the datalog and therefor the server modules would not recognize those changes.
Could you (till/falko) give me some hint on how to proceed here?

Thank you.
__________________
Marius Cramer

pixcept KG

Last edited by Croydon; 19th June 2012 at 11:23.
Reply With Quote
Sponsored Links
  #2  
Old 19th June 2012, 11:54
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,421
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
Default

Quote:
Is it possible to store information from one form into separate db tables?
Not with the default functions of the form, but you can ovverride each function. see tform_actions class which to see which even functions can be overridden.

Btw. I would still prefer if you implement i as direct user -> DB relationship and not with 3 tables, so that you have a users table and a db table and one user can access one or more databases. This woould fit into the form framework better, is simpler to understand for the user.

Quote:
but as far as I can see the datalog and therefor the server modules would not recognize those changes.
This would only be the case if you use the wrong functions to from the db class to insert and update data into this table. If you use the datalogInsert(), datalogUpdate() and datalogDelete() functions to insert data to that table, then all data is mirrored to slave servers as well and you can create a event hook in a server side plugin.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 19th June 2012, 11:54
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,421
Thanks: 812
Thanked 5,205 Times in 4,081 Posts
Default

Quote:
Is it possible to store information from one form into separate db tables?
Not with the default functions of the form, but you can ovverride each function. see tform_actions class which to see which even functions can be overridden.

Btw. I would still prefer if you implement i as direct user -> DB relationship and not with 3 tables, so that you have a users table and a db table and one user can access one or more databases. This woould fit into the form framework better, is simpler to understand for the user.

Quote:
but as far as I can see the datalog and therefor the server modules would not recognize those changes.
This would only be the case if you use the wrong functions to from the db class to insert and update data into this table. If you use the datalogInsert(), datalogUpdate() and datalogDelete() functions to insert data to that table, then all data is mirrored to slave servers as well and you can create a event hook in a server side plugin.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 19th June 2012, 13:10
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 922
Thanks: 16
Thanked 258 Times in 206 Posts
 
Default

Quote:
Originally Posted by till View Post
Btw. I would still prefer if you implement i as direct user -> DB relationship and not with 3 tables, so that you have a users table and a db table and one user can access one or more databases. This woould fit into the form framework better, is simpler to understand for the user.
I get your point but I think it is much more useful to have multiple users for one database than having multiple databases for each user.
I know it is easier using phpmyadmin because you have a listing of all databases of the user, but I still believe it is lot more benefit having read-only user(s) to access a database.
So if you want to have multiple databases for a user and multiple users for a database I think there is no way to manage this using only 2 tables, although it would fit better into the form framework. Don't you agree?
__________________
Marius Cramer

pixcept KG
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail hold in Q fisherofer Installation/Configuration 1 5th February 2012 13:29
server.sh not starting up tuxillo Installation/Configuration 8 31st December 2010 14:14
Howto analyse a IPTables firewall issue? chillifire Installation/Configuration 2 27th August 2008 07:23
Help with Bluetooth PAND josto HOWTO-Related Questions 1 7th August 2007 20:53
Storing Session Data in MySQL Table Mosquito Programming/Scripts 4 14th July 2007 21:37


All times are GMT +2. The time now is 04:16.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.