Hey everyone,
Like everyone else in this area of the forum, I am having a little problem. Now I have searched and searched but I could not find one solution that worked for me. I think ChronoForms is an amazing piece of software and the solution to all my problems if I can figure out how to work it. I have been working on trying to get this to work for a little over a month now and still no luck.
The story is this, I am trying to create an online game and I would like ChronoForms to query the Joomla Database for items. I am running on Joomla 1.5 and ChronoForms v4.
I am trying to use the DB_Record_Loader to load a single value into my form. The details are this:
Database Field: cb_companyname
Table: jos_comprofiler
Request Param: token
Load Fields: Yes
Everything else was left alone. The record is supposed to load into a Text Field with the following information:
Field Name: cb_companyname
Field ID: cb_companyname
Field Class: cb_companyname
Field Title: Company Name
Label Text: Company Name
I have tried a few things like using different request param's but still had no luck. The field I am trying to load is from the Community Builder table but I wouldn't think that had much of a problem since I was using a DB Load event and not custom code. Either way, I would appreciate any help I can get.
As a side question, is it possible to have multiple (single) DB_Record_Loader events on one form?
P.S. This form is linked to a menu item (not sure if it has any effect on the form loading). The debugger gave me this:
Like everyone else in this area of the forum, I am having a little problem. Now I have searched and searched but I could not find one solution that worked for me. I think ChronoForms is an amazing piece of software and the solution to all my problems if I can figure out how to work it. I have been working on trying to get this to work for a little over a month now and still no luck.
The story is this, I am trying to create an online game and I would like ChronoForms to query the Joomla Database for items. I am running on Joomla 1.5 and ChronoForms v4.
I am trying to use the DB_Record_Loader to load a single value into my form. The details are this:
Database Field: cb_companyname
Table: jos_comprofiler
Request Param: token
Load Fields: Yes
Everything else was left alone. The record is supposed to load into a Text Field with the following information:
Field Name: cb_companyname
Field ID: cb_companyname
Field Class: cb_companyname
Field Title: Company Name
Label Text: Company Name
I have tried a few things like using different request param's but still had no luck. The field I am trying to load is from the Community Builder table but I wouldn't think that had much of a problem since I was using a DB Load event and not custom code. Either way, I would appreciate any help I can get.
As a side question, is it possible to have multiple (single) DB_Record_Loader events on one form?
P.S. This form is linked to a menu item (not sure if it has any effect on the form loading). The debugger gave me this:
DEBUG DATA
DB_RECORD_LOADER
SELECT * FROM `jos_comprofiler` AS `JosComprofiler` WHERE `cb_companyname` = ''
Hi ali5541,
Have you checked that those columns are in jos_comprofiler?
I don't have a recent CB Installation but looking at an old one these are the column names from jos_comprofiler
CB is quite a complex extension and it may need a more complex query to extract the info you need.
Bob
Have you checked that those columns are in jos_comprofiler?
I don't have a recent CB Installation but looking at an old one these are the column names from jos_comprofiler
`jos_comprofiler`.`id`, `jos_comprofiler`.`user_id`, `jos_comprofiler`.`firstname`, `jos_comprofiler`.`middlename`, `jos_comprofiler`.`lastname`, `jos_comprofiler`.`hits`, `jos_comprofiler`.`message_last_sent`, `jos_comprofiler`.`message_number_sent`, `jos_comprofiler`.`avatar`, `jos_comprofiler`.`avatarapproved`, `jos_comprofiler`.`approved`, `jos_comprofiler`.`confirmed`, `jos_comprofiler`.`lastupdatedate`, `jos_comprofiler`.`registeripaddr`, `jos_comprofiler`.`cbactivation`, `jos_comprofiler`.`banned`, `jos_comprofiler`.`banneddate`, `jos_comprofiler`.`unbanneddate`, `jos_comprofiler`.`bannedby`, `jos_comprofiler`.`unbannedby`, `jos_comprofiler`.`bannedreason`, `jos_comprofiler`.`acceptedterms`CB is quite a complex extension and it may need a more complex query to extract the info you need.
Bob
I'm pretty positive that those columns are in jos_comprofiler. When new players create an account, they create a company name at sign-up. That company name is saved into cb_companyname in the jos_comprofiler database. (I checked phpmyadmin, the company name's for the different players is there).
I'm just not sure what to do. Is their special way I should be doing the query? Anything special I should add to the query settings? If you need screenshots, I would be more then willing to provide them.
Thanks Again,
-Ali
I'm just not sure what to do. Is their special way I should be doing the query? Anything special I should add to the query settings? If you need screenshots, I would be more then willing to provide them.
Thanks Again,
-Ali
Hi Ali,
I notice that the query in the debug info is
You can also try turning on Site Debugging in Global Configuration temporarily to see what query is being run.
Bob
I notice that the query in the debug info is
SELECT * FROM `jos_comprofiler` AS `JosComprofiler` WHERE `cb_companyname` = ''There's no value for the company name there? Should that be being passed in the URL?You can also try turning on Site Debugging in Global Configuration temporarily to see what query is being run.
Bob
I triple checked my database, there is actual data in the database.
Using this code:
RSFormPro is able to load the data I'm requesting directly into a text field. However, RSFormPro has been my worst investment. It looks absolutely horrible. How can I get a DB Data Loader to use this code and pass on the information to a text field in my form? I have tried quite a few things and have had no luck.
I'm sorry for being a bother.
Using this code:
//<code>
$my = & JFactory::getUser();
$db = JFactory::getDBO();
if ($my->get('id'))
{
$db->setQuery("SELECT `cb_companyname` FROM `#__comprofiler` WHERE `user_id`='".$my->get('id')."' LIMIT 1");
return $db->loadResult();
}
//</code>RSFormPro is able to load the data I'm requesting directly into a text field. However, RSFormPro has been my worst investment. It looks absolutely horrible. How can I get a DB Data Loader to use this code and pass on the information to a text field in my form? I have tried quite a few things and have had no luck.
I'm sorry for being a bother.
Hi ali5541,
For this single entry the easiest way is to use a Custom Element and add the code in there. ChronoForms will then wrap it in the 'usual' divs.
Bob
For this single entry the easiest way is to use a Custom Element and add the code in there. ChronoForms will then wrap it in the 'usual' divs.
<?php
$my = & JFactory::getUser();
$cb_companyname = '';
$db = JFactory::getDBO();
if ( $my->id ) {
$query = "
SELECT `cb_companyname`
FROM `#__comprofiler`
WHERE `user_id` = '{$my->id}'
";
$db->setQuery();
$cb_companyname = $db->loadResult();
}
?>
<input type='text' name='cb_companyname' id='cb_companyname'
value='<?php echo $cb_companyname; ?>' />Bob
This topic is locked and no more replies can be posted.
