I have a feeling i amconfusing myself

OK,heres my scenario again. I have a form that is in a block which uses the dolphin variables and such. in this form, i have hidden and non hidden fields. the non hidden fields are type => custom and display data from one of several database tables. example - question 1 is info from a column in table 1, question 2 is the info from a column in table 2, and so on. The hidden fields, are the same values as the non hidden fields, but there are 2 fields that I need help with.

code for one of the 2 fields is as follows:


                'header4' => array(
                    'type' => 'block_header',
                    'caption' => '<a href="TxPlan.php?client=' . $client . '" onclick="loadDynamicPopupBlock(596, this.href); return false;" class="top_members_menu">' . _t("_Working On") . '</a>',
                ), 
                'WorkingOn1' => array(
                    'type' => 'custom',
                    'content' => _t("_TxPlan number", ($Tx_Plan_num_rows > 0 ? $Tx_Plan_num_rows : _t("_TxPlan number_no"))), /* This will display a message "The client is currently working on # issues" */
                    'colspan' => true,
                ),
                'WorkingOn' => array(
                    'type' => 'hidden',
                    'name' => 'WorkingOn',
                    'value' => $WorkingOn, /* I need this to show the actual name of the issues the client is working on to be input into the database as a single line. ex: Relationships, Suicide, Addictions" . So basically, I need this sql statement to be ran  on this line -

$client = $this->oProfileGen->_iProfileID;

$Tx_Plan = mysql_query("SELECT issue FROM tx_plan WHERE client_id = $client");
$Tx_Plan_num_rows = mysql_num_rows($Tx_Plan);

while ($Tx_Plan_fields = mysql_fetch_row($Tx_Plan)) {
   
    echo $Tx_Plan_fields[0] . ', ';
}
mysql_free_result($Tx_Plan);

*/
                      'db' => array (
                        'pass' => 'Xss',  // do XSS clear before getting this value, see BxDolFormCheckerHelper class for all pass* functions
                    ),
                ),
                'header4_end' => array(
                    'type' => 'block_end'
                ),

caredesign.net
Quote · 24 Mar 2013

another question which may help me figure this out - is it possible to run an sql query in a language key?

caredesign.net
Quote · 24 Mar 2013

No. Queries cannot be in languge keys.

I am not understanding the problem.

Perhaps your not running the query before you generate the form which you must do so the form has the data it needs.

Here istead of echoing you store in a variable which your form seems to have but your not using it.

Instead of echo $Tx_Plan_fields[0] . ', ';

It would be $sWorkingOn .= $Tx_Plan_fields[0] . ', ';

But all of that has to be above the code that creates the form so the vars are filled before the form tries to access them.

Not really understanding what your having problems with tho.

https://www.deanbassett.com
Quote · 24 Mar 2013

i didnt post the whole page code as it is rather long, but at the very top of the file is my sql query:

$client = $this->oProfileGen->_iProfileID;

$Tx_Plan = mysql_query("SELECT issue FROM tx_plan WHERE client_id = $client");
$Tx_Plan_num_rows = mysql_num_rows($Tx_Plan);

while ($Tx_Plan_fields = mysql_fetch_row($Tx_Plan)) {
   
    echo $Tx_Plan_fields[0] . ', ';
}
mysql_free_result($Tx_Plan);

As it stands right now, this gives me the number of "issues" the client is working on here:

                'WorkingOn1' => array(
                    'type' => 'custom',
                    'content' => _t("_TxPlan number", ($Tx_Plan_num_rows > 0 ? $Tx_Plan_num_rows : _t("_TxPlan number_no"))), /* This will display a message "The client is currently working on # issues" - from the _TxPlan number language key*/
                    'colspan' => true,
                ),

all that is working properly, but now I need to Display the results of my query so that they can be listed as isue1, issue2, issue3, and so on - equaling the number of issues from the language key and variables

Example:

The client is currently working on 3 issues:

issue1, issue2, issue3

caredesign.net
Quote · 24 Mar 2013

Ok. well as i pointed out. Don't echo the values, store them in a var. Then the var is passed to the form.

https://www.deanbassett.com
Quote · 24 Mar 2013

OK, I am a retard.

I had already done what you suggested deanos, and thought it wasnt working because when I tried to display the data, it returned an empty line. Then, after looking at your suggestion, and seeing it was the same as what I tried, I knew it was something stupid on my part.

And as usual, it was. I was using a field type of custom with a value parameter, needed to change the value to content to display the data. Now that I can see it working, i will now change to hidden type and hope it inputs the info like i want into the database.

Thanks Deanos

caredesign.net
Quote · 24 Mar 2013

Works like a charm - thanks again for your time Deanos

caredesign.net
Quote · 24 Mar 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.