• 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: SQL Mapping {last_insert_id} Unsuccessful

SQL Mapping {last_insert_id} Unsuccessful 11 years 6 months ago #25323

I have created a dynamic selector list that is pulling the usernames and user ids from the #_users table. I need to assign the user id that is selected as the userid of the submitted form. I can successfully change the IDs in the entire column so I know I've mapped it correctly but my WHERE fails. I can't seem to get it to map the correct row. The only way I can think this will work is to set the WHERE to query the formID but when I use the place holder {last_insert_id}, the id does not get changed. I am wondering if I need to do use the $mappings variable in the "Scripts called after form has been processed field". If this is the case I'm not sure how to correctly write this type of syntax.
I will gladly post the final solution for others to use, I'd bet I'm not the only one who has run into this issue.
Please help if you can, any advice will be greatly appreciated.
The administrator has disabled public write access.

SQL Mapping {last_insert_id} Unsuccessful 11 years 6 months ago #25338

This is an update.
I have decided that the update has to occur post form data so I removed the mapping and have placed the following code in my post form data area:

$db =& JFactory::getDBO();
$db->setQuery(UPDATE xside__rsform_submissions SET UserId = '.$_POST.' ORDER BY SubmissionId DESC LIMIT 1);
$db->query();

I ran a test query in phpmyadmin and replaced the ="" with an actual value and it successfully updated the last row so that worked there. But the above does not update the row when placed in the post form data area.
Does anyone see any reason this wouldn't work?
Last Edit: 11 years 6 months ago by donaldmoore.
The administrator has disabled public write access.

SQL Mapping {last_insert_id} Unsuccessful 10 years 10 months ago #28136

At a very quick drive-by glance, you are using the whole $_POST array in that statement as if it was a single value. That is/was almost definitely the problem.
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!