| Index
» Projekty
» phpMyEdit
» Fórum
» How to use the value of a field for another field II |
 |
franciscohm
Založený: 08.05.2008
Príspevky: 33
Zaslal: 2008-11-12 14:05
Návrat hore
Odpovedať s citátom
|
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:
| Kód: |
$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
Založený: 08.05.2008
Príspevky: 33
Zaslal: 2008-11-12 22:11
Návrat hore
Odpovedať s citátom
|
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
Založený: 08.05.2008
Príspevky: 33
Zaslal: 2009-01-24 18:58
Návrat hore
Odpovedať s citátom
|
I got a solution. I guess it is not the most efficient one, but at least it works for my case:
| Kód: |
$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:
| Kód: |
| 'name' => 'Date of Filenumber: '.$result_3, |
|
franciscohm
Založený: 08.05.2008
Príspevky: 33
Zaslal: 2009-01-24 19:09
Návrat hore
Odpovedať s citátom
|
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!
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|