Simple problem:
I want to display the text "minus" when the field value is 0 and "plus" when 1. On a browse screen it works fine by using
Code: Select all
IF(genpos_strand= "1", "plus", IF( genpos_strand= "0", "minus", " "))
Code: Select all
function FetchStrand() {
//build sql
$sql = "
Select genpos_strand,
CASE WHEN genpos_strand = '0' THEN 'minus'
WHEN genpos_strand = '1' THEN 'plus'
ELSE 'not determined' END AS genpos_strand
FROM genomic_position
";
//run query and fetch results from db
$q = nuRunQuery($sql);
$r = db_fetch_object($q);
return $r->genpos_strand;
}
Can I use $('#genpos'.text()) somehow?
Thanks for any hints.
Tinka