Admin Config question

augustobotossi 04 Jul, 2009
Hello All!

You guys are great and I want to thank you for the awesome components and the precious support you guys provide!
I am a newbie on the joomla universe and your components have been of great help.

My question is related to the Admin Config area: how can I get the value of a field related to the record that is being edited in the Admin view? Basically I need to get the information related to the user that created the record so I can do a search on CB and than I will perform some changes in the user's profile. I am writing the code in the OnSave box.

I tried $MyRow but it is not working for me.

Could you help me?

Thank you very much!

GreyHead 08 Jul, 2009
Hi augustobotossi,

It looks as though it's still $row in the Admin edit - please give that a try.

augustobotossi 08 Jul, 2009
Thanks Bob for your reply!

I tried but it still not working.

That's my code:
$localdb =& JFactory::getDBO();
$field1 = $row->cf_user_id; 
$localquery = "UPDATE jos_comprofiler SET cb_pontos = cb_pontos+50 WHERE user_id = $field1";

Am I doing something wrong?

GreyHead 09 Jul, 2009
Hi augustobotossi,

Well something is wrong but we don't know what so some debugging is required.

Try adding quotes to the SQL
$localquery = "UPDATE `#__comprofiler` SET `cb_pontos` = `cb_pontos`+50 WHERE `user_id` = '".$field1."';";

Try copying the SQL and pasting it into PhpMyadmin using a known good value of $field1 and see if you get any errors.

Try echoing out $row->cf_user_id to make sure that it has a value.

augustobotossi 09 Jul, 2009

I tried to execute the query with quotes but it sill didn't work.

I also tried to exeute the query with the phpmyadmin and it did work. So I believe the problem is with the $row command.

Is there anything else I can do?

If it helps, the version of my CC is 1.2.

GreyHead 09 Jul, 2009
Hi augustobotossi,

Hopefully Max will pass by and give us the right code here. If not. I'll try digging around in the morning - I'm not very familiar with the ChronoConnectivity code and a lot of it changed in the last release.

augustobotossi 10 Jul, 2009
Thanks Bob.

Hopefully Max will helps us out!

augustobotossi 13 Jul, 2009
Bob and Max,

Any news on the subject?

augustobotossi 16 Jul, 2009
Is there anyone having the same problem?

This topic is locked and no more replies can be posted.