| Index
» Projekty
» phpMyEdit
» Fórum
» How to find value from another field |
 |
kdlucas
Založený: 15.10.2006
Príspevky: 3
Zaslal: 2009-05-18 21:07
Návrat hore
Odpovedať s citátom
|
I have a database that uses phpMyEdit to create URL's to find the source code to file names. The URL link prefix is dependent on the value of another field.
I have already defined a field:
$opts['fdd']['testset']
and another one:
$opts['fdd']['sourceurl']
So, I wanted to stick a case statement to determine the value of URL, something like this:
switch ($opts['fdd']['testset']['value']){
Case 'Accept':
$opts['fdd']['sourceurl']['URL'] = 'http://url1/$value;
break;
Case 'LTP':
$opts['fdd']['sourceurl']['URL'] = 'http://url2/$value;
break;
}
However, I noticed that $opts['fdd']['testset']['value'] is not set. How do I get the value of a the field testset?
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2009-05-19 14:51
Návrat hore
Odpovedať s citátom
|
To locate some examples which might be useful, use the forum's Search box to search for the MySQL function "CONCAT".
|
kdlucas
Založený: 15.10.2006
Príspevky: 3
Zaslal: 2009-05-20 00:40
Návrat hore
Odpovedať s citátom
|
Ok, just to help anyone else who might be wondering about this, I used the following with success:
$opts['fdd']['name']['sql|LF'] =
'concat("<a href=\"http://",
CASE testset
WHEN "Accept" THEN "AcceptURL"
WHEN "LTP" THEN "LTPURL"
END,
sourceurl,"\">",name,"</a>")';
This allowed the url to point to a different location depending on the value of the testset field.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|