pier67
Pierantonio
I have two tables in separate db.
I have a fabrik form with a field plugin where users can store in the first table the id of a related record in the second table.
I need to set-up a php function in the module php plugin that on form submission will look (using submitted id) at a filename stored in the second table and set it as a filepath in the first table with a concat function.
I have tried to set this code, but nothing happened:
I think that I need to use value from module, because this way it will update all the records that match the id from the two tables. I need to update only the record that I am editing. Any help?
I have a fabrik form with a field plugin where users can store in the first table the id of a related record in the second table.
I need to set-up a php function in the module php plugin that on form submission will look (using submitted id) at a filename stored in the second table and set it as a filepath in the first table with a concat function.
I have tried to set this code, but nothing happened:
PHP:
mysql_query("
UPDATE db1.caduti
SET db1.caduti.foto_ok =
CONCAT('/images/joomgallery/originals/deceduti_sul_fronte_russo_3/', db2.xxx_joomgallery.imgfilename)
WHERE db2.xxx_joomgallery.id = db1.caduti.id_joomgallery");
I think that I need to use value from module, because this way it will update all the records that match the id from the two tables. I need to update only the record that I am editing. Any help?