seshu
Joined: 19 Apr 2008
Posts: 2
Posted: 2008-04-19 12:43
Back to top
Reply with quote
|
Hi,
I want to apply a php function on the field value before populating the value in the table cell. But currently I cannot access the value directly through a variable or array.
Is there any way where I can get the field value into a variable, so that I can apply more functions or do more operations on it, before populating the data?
Thanks,
Seshu
|
seshu
Joined: 19 Apr 2008
Posts: 2
Posted: 2008-04-27 05:25
Back to top
Reply with quote
|
| doug wrote: |
| Please post an example of what you are attempting to do. |
> I have a list of employee in my database table.
I want to color the rows, for those employees who belong to a Department ABCD.
Like this:
if($opts['fdd']['dept'] == "ABCD") $bgColor = "blue";
echo "<Tr bgcolor=".$bgColor."><Td>Employee - Dept</Td></Tr>";
Or else,
If I build up an array of my departments and respective colors, is there a way that I can pass the department name (which is coming from a db column) as a key to my array, based on which I can color the row.
Eg:
$dept['ABCD'] = "blue";
$dept['PQRS'] = "RED";
$dept['XXXX'] = "yellow";
Can I do something like
echo $dept[<my database column name>];
Thanks in advance.
Seshu
|
|
Post new topic
Reply to topic
|
|
|