Single Value from a Row

SoilentRed

Caaan do!
Greetings everyone!
I've created a custom profile with fabrik to include Company name, address, etc... These users will be entering data into a form with a public list/details. The details of each list should include the company name, address and so on.

How do I make it so that each of there entries takes automatically takes this info without them having to enter it?

I've seen this documentation: http://fabrikar.com/forums/index.php?wiki/common-php-tasks/#select

I'm unclear on where to enter that code. I've tried creating a hidden field element, checking "eval" and entering the php code for Load a single ROW of data as an object as described in the documentation. I lead it info the default field. Is that where it goes?

When I save the entry and check the phpmyadmin and fabriks list database, the code is stored and not the value I am looking for. Just a string of code. Can someone help me out. I thought this would be relatively simple.

Thank you much.

Here's is the code I am using:

Code:
$db = JFactory::getDbo();
$query = $db->getQuery(true);
 
$query
    ->select('business')
    ->from('business_signup')
    ->where('business_ID = ' . $db->quote('business_id'));
 
$db->setQuery($query);
$business = $db->loadResult();
 
Thank you for the swift reply. Let me be more clear.

When the business signs up, they enter their business details (biz name, address, phone number etc...).
The Joomla user for the business account will be filling out a form for "shoppers" to view. Shoppers include the public and basic registered users.
When a "shopper" clicks a list item through to it's details, the details for the Business that posted the listing should be be seen along side the details of the listing. Like this:

Item name: Washburn Dimebolt Guitar
Price: $700
Condition: New
Seller Name: Dimebag Darrell
Seller address: 123 Main St
Phone: (555) 555-5555

Since company details are consistent, they should not have to enter business name, address, etc for every listing they put up. They should only concern themselves with the details specific to the item they are selling (item name, price, condition). How can I do this? I am trying to have it so that there are hidden field elements with some php in the default text area that uses the user id that was collected when they sign up and reference it to get a company name? If there's a better way to do it, please let me know. If not, can you tell me how it's done? Thank you!
 

Members online

No members online now.
Back
Top