Forums

View my Table Records (based on username)

panosp 26 Aug, 2010
Hi everybody from me also.
hat
I need your help maybe for a simple problem.

I started to use Chronoforms and after all i have finally made a form with 4 fields
name
username
password
prfl_company

with the help of Joomla Registration plugin and DBConnection i create onsubmit a user in jos_users and a record in prfl(username*, prfl_company) table.

Until now it's OK and the user can use his UserName and Password to login to the site.
How can user change his profile ????

I can't yet manage to setup a form that each user could change his profile (prfl table).
How can I pass to the link of the form the username of the user already login.


Thanks in advance

Panos
GreyHead 27 Aug, 2010
Hi Panos,

Please search here on 'getUser' for many posts on getting the logged in user's id.

Bob
panosp 27 Aug, 2010
Hi greyhead,

could you be a little be more specific because, before i write the post i have seen your previous posts about getUser but i couldn't managed.

Do you have a specific post??

Thanks again
Panos
GreyHead 27 Aug, 2010
Hi Panos,

In a form you'd use something like this[code]
<?php
if ( !$mainframe->isSite() ) { return; }
$user = JFactory::getUser();
$db =& JFactory::getDBO();
$query = "
    SELECT *
        FROM `#__some_table`
        WHERE `cf_user_id` = '".$user->id."' ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
?>

Bob
panosp 27 Aug, 2010
Hi bob,

i don't understand where i have to put this.

I have made a from with wizard, aftre that i enable profile plugin and trying to see the data???

I what point i must place the code???

Thanks again
Pan
GreyHead 27 Aug, 2010
Hi Panos,

You don't need this code if you are using the Profile Page plugin. Please see the plugin Help tab.

Bob
panosp 27 Aug, 2010
I didn't understand what to place in 'Request Parameter Name'????

I have place Table Name:The table name
Target Field Name: username (is it the same with username of jos_users). It is also primary key of the table

What i must place to 'Request Parameter Name' so the form data will depends on logged in user???

Panosp
GreyHead 27 Aug, 2010
Hi Panos,

I think that if you leave 'Request' Parameter name empty then ChronoForms will use the current User ID.

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