Forums

DB Record Loader not automatically loading

swmckay 10 Aug, 2011
Hello,

I've followed the CV4 DB Record Loader tutorial to build a customer profile page. It works when I manually add in "&token=" and the cf_uid of my fake customer's profile record.

However, when I log in using a fake customer login/password and select the link to the customer profile page (the record was saved to the db previously by the fake customer), it doesn't automatically load the "&token=" and the cf_uid of that particular customer. The form/page comes up but the fields are not populating with the record.

Any guidance is appreciated!
Max_admin 13 Aug, 2011
Hi,

In order to load a record based on logged in user's data you will need to use this in the WHERE box:


<?php
$user = JFactory::getUser();
?>
cf_user_id='<?php echo $user->id; ?>'


assuming the table column storing the user's id is cf_user_id (this is ok if you created the table using Chronoforms)

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
swmckay 15 Aug, 2011
Max,

Excellent, thanks. It worked for me.

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