| Index
» Projekty
» phpMyEdit
» Fórum
» URL using value of non-key column rather than display value? |
 |
pgowling
Založený: 20.02.2004
Príspevky: 6
Zaslal: 2004-02-20 09:46
Návrat hore
Odpovedať s citátom
|
Hi,
I'm trying to make a URL link using the value of a column rather than the label that's displayed (this comes from another lookup table), the field whose value I'm trying to display is also not the key of the table:
Here's the extract of the $opts code:
$opts['fdd']['field_type_id']['values']['table'] = 'ari_field_types';
$opts['fdd']['field_type_id']['values']['column'] = 'field_type_id';
$opts['fdd']['field_type_id']['values']['description'] = 'field_type_label'; // optional
$opts['fdd']['field_type_id']['URL'] = '/modules.php?name=Item_Admin&page=maint_field_type&field_type_id='.<value of column 'field_type_id'>;
The string "<value of column 'field_type_id'>" is what I'm trying to access the value for. Using $key gives me the key column in the table which is another field, $value gives me the value of the column 'field_type_label' from the lookup table. Does anyone have any ideas?
Regards,
Phil
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-02-20 10:00
Návrat hore
Odpovedať s citátom
|
i see three possibilities:
- remove description option, which will display the id in your table (probably not a good idea)
- check bug #127 and use $rough_row[$name] to get that id
- hack urlDisplay function similarly to way it was hacked to remove trimming
i would prefer 2nd
|
pgowling
Založený: 20.02.2004
Príspevky: 6
Zaslal: 2004-02-20 16:14
Návrat hore
Odpovedať s citátom
|
I've tried using $rough_row[$name] but get nothing. I'm currently using phpMyEdit 5.4, do I need a patch or something in order to use this?
I've been through Bug 127, unfortunately this does not help me in getting this working...
|
pgowling
Založený: 20.02.2004
Príspevky: 6
Zaslal: 2004-02-20 16:49
Návrat hore
Odpovedať s citátom
|
I have a workaround of passing the 'field_type_label' $value instead of the 'field_type_id' but this will require me to add code to ensure this field is unqiue when input. Not ideal but workable.
If anyone can help with my previous $rough_row query on how to get it working that would still be much appreciated :-)
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-02-22 22:37
Návrat hore
Odpovedať s citátom
|
See http://opensource.platon.sk/forum/projects/viewtopic.php?t=250
For a similar problem and a solution using 'sql' and manual url creation.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|