This topic is locked

How do you change a displayed value in a table?

10/19/2008 4:19:37 PM
PHPRunner General questions
E
erago author

For example,
In PHPRunner 4.2

I have Table_A and it has a Field_B , and sometimes there is a record when Field_B is "NULL" and it shows a blank space in Field_B
how do I change what the displayed value of Field_B to something else like [.color="#2E8B57"][.b]"Available"[/.b][/.color] if the value is NULL?
Table_A ____

........... |Field_A ... | Field_B ..... |

........... |-------------|----------------|

........... | "Detroit" | "___ " | (not desired)

........... | "Detroit" | "" | (Desired)
where would I do it and how? Visual Editor/Field_B/Properties/ View as/ Custom ? or in Events ?

T
thesofa 10/19/2008

For example,

In PHPRunner 4.2

I have Table_A and it has a Field_B , and sometimes there is a record when Field_B is "NULL" and it shows a blank space in Field_B
how do I change what the displayed value of Field_B to something else like [.color="#2E8B57"][.b]"Available"[/.b][/.color] if the value is NULL?
Table_A ____

........... |Field_A ... | Field_B ..... |

........... |-------------|----------------|

........... | "Detroit" | "___ " | (not desired)

........... | "Detroit" | "" | (Desired)
where would I do it and how? Visual Editor/Field_B/Properties/ View as/ Custom ? or in Events ?



probably best done in events, but a code snippet in visual editor could do it too

something like

If (is_null($values["Field_B"]))


or

If ($values["Field_B"]===NULL)


the SQL statement,

Where Field_B IS NULL



only works in sql, if you test for the NULL value in SQL, iE in the sql query string forming the basis of the page, then you use

Where Field_B IS NULL



but if you are testing with PHP, ir in the page's code, you must either use the is_null function or the ===NULL, note the three = signs.
Try here for a bit more about the function.

HTH