• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Mapping to tables in a different directory

Mapping to tables in a different directory 14 years 4 months ago #9333

Hello
I have the following problem. I would like to map the data to tables to a different form Joomla that is not installed in the main level.
I thought there is maybe a solution changing the path reference from the mappin plugin in the php file because the system config of the plugin itself does offer no solution. I think it is pretty common to map to tables form DBs in a different directory from Joomla.
How can I change the path for mapping?

Best regards and thank you in advance for your response.
The administrator has disabled public write access.

Re:Mapping to tables in a different directory 14 years 4 months ago #9337

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 733
  • Thank you received: 60
Hello,

This cannot be achieved with the mappings plugin, this plugin only allows you to map submission in different tables of the same database.
In order to achieve this you will have to add a script in the Scripts called on form process, i have written an example below
if (count($_POST) > 0) {
$_POST['form']['address'] = mysql_real_escape_string($_POST['form']['address']);
$_POST['form']['phone'] = mysql_real_escape_string($_POST['form']['phone']);
 
$option['driver'] = 'mysql';
$option['host'] = '127.0.0.1';
$option['user'] = 'user';
$option['password'] = 'password';
$option['database'] = 'database';
$option['prefix'] = '';
 
$database2 = & JDatabase::getInstance($option);
 
$database2->setQuery("INSERT INTO table (`address`,`phone`) VALUES ('".$_POST['form']['address']."','".$_POST['form']['phone']."')");
$database2->query();
}
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!