| Index
» Projects
» phpMyEdit
» Forum
» How to use the value of a field for another field II |
 |
franciscohm
Joined: 08 May 2008
Posts: 33
Posted: 2008-11-12 14:05
Back to top
Reply with quote
|
Based on what I saw in
http://opensource.platon.sk/forum/projects/viewtopic.php?t=31392
....
I have a field called "
currency
" with posible values "USD", "EUR", "GBP", etc.
I want to use the value of that field in the name of other field. I have a field called "
amount
" whose code is:
| Code: |
$opts['fdd']['amount'] = array(
'default' => '',
'input' => '',
'maxlen' => 15,
'name|FLX' => 'Amount',
'name|ACPDV' => 'Amount (Currency: PMEtable0.currency)',
'options' => 'ACPVDFLX',
'select' => 'T',
'size|ACP' => 12,
'sqlw' => 'TRIM("$val_as")',
'escape' => false,
'sort' => true
); |
However I get:
Amount (Currency: PMEtable0.currency)
Instead of
Amount (Currency: USD)
Amount (Currency: EUR)
Amount (Currency: GBP)
etc. etc.
What am I missing? (PLEASE HELP ME)
Thanks very much in advance
PD: I have aldo tried to put ."PMEtable0.currency". and things like that with no success.
|
franciscohm
Joined: 08 May 2008
Posts: 33
Posted: 2008-11-12 22:11
Back to top
Reply with quote
|
That is not exactly what I wanted. However i realize what I want is very likely to be impossible so that I have used it and now I have it in a way very similar to what I wanted.
Cheers again!
Francisco
|
franciscohm
Joined: 08 May 2008
Posts: 33
Posted: 2009-01-24 18:58
Back to top
Reply with quote
|
I got a solution. I guess it is not the most efficient one, but at least it works for my case:
| Code: |
$recordid = @$_REQUEST['PME_sys_rec'];
$query_filenumber = 'SELECT file_number FROM a_system_offers_lmr WHERE id='.$recordid;
$result_1 = mysql_query($query_filenumber) or die ("No se ha podido ejecutar al consulta sobre la Base de Datos.");
$result_2 = mysql_fetch_array($result_1);
$result_3=$result_2[file_number]; |
So now that I have the value of the field "file_name" (of the current record) stored in $result_3, I can use it almost everywhere. For instance in the description of a another field:
| Code: |
| 'name' => 'Date of Filenumber: '.$result_3, |
|
franciscohm
Joined: 08 May 2008
Posts: 33
Posted: 2009-01-24 19:09
Back to top
Reply with quote
|
There is a little "error" in the code i posted before: The update of the description is delayed. I mean, you need to save twice to see the results.
In my case it is not important, but take it into account for other cases!
|
|
Post new topic
Reply to topic
|
|
|
|