8 years ago
4
Topic

Inserting data in two tables using a single field? Example: The email field, how do I save this field in the User table and content using a single field

Get a Book for SEBLOD
4229 Posts
Kadministrator
8 years ago
2
Level 1

You can't store to 2 tables directly, what you can do is either

  • Create second field with different storage, than use computation to copy value from first field when it is filled
  • Insert data yourself using onBeforeStore or on AfterStore plugins from Code pack
8 years ago
1
Level 2

I've done it I wonder if there is a way without that I need to create another field may be using PHP but would like a tutorial

4229 Posts
Kadministrator
8 years ago
0
Level 3

There is another way - use SD live plugin for second field, but I would not know of any method to store value to 2 tables using jsut one field.

To use onBeforeStore or onAfterStoree there is no tutorial for this, you need to know joomla&php programming to use them, this might help

https://docs.joomla.org/Inserting,_Updating_and_Removing_data_using_JDatabase

Note: in my answer above "than use computation to copy" should be "than use conditionals to copy"

8 years ago
0
Level 1

You could also concatenate it, just this one field, and choose your storage. I don't know if you can store in any table I assume you can. 

Get a Book for SEBLOD