What to do after I make changes in mysql database table

bontemuis

Member
I have a list which is connected to a mysql database table. Suppose I want to add or delete columns in my table, what do I need to do in order to keep things in sync?
 
Add/delete (= trash, empty trash with checking "...drop (delete) the associated database column...") elements in Fabrik.
 
Because I cannot find the button for adding a new post anymore (please help)elp), I just continue with this post.
I would like to achieve this:
A have a form and I added a php plugin. At the "Start of Form Submission" I want to update a row in another table. I think something is wrong in the where clause, because if I directly point to a value for 'user_id', it does work. This is my code:

$db = JFactory::getDbo();
$user_id_now = (int) $formModel->getElementData('test___user_id');
$query = $db->getQuery(true);
$query->update('controlpanel')->set('veld1 = ' . $db->quote('1'))->where('user_id = ' . (int) $user_id_now);
$db->setQuery($query);
$db->execute();

Can somebody explain what goes wrong here? I've already been testing with "$name = $formModel->formData['tablename___name'];" as well...
 
Var_dump is always good to see what you really get.
You need the Joomla user id, probably you get the username (or whatever you have set your user_id element to display)
Try
$user_id_now = (int) '{test___user_id_raw}';
 
Thanks again troester, that solved my problem! I will figure out how this var_dump thing works. Leaves me with one question for now: where can I find the forum button to add a new post?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top