Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  CRITICAL: Handle to the database fields values

phpMyEdit General     CRITICAL: Handle to the database fields values
Odoslať novú tému   Odpovedať na tému    
 
seshu     Založený: 19.04.2008   Príspevky: 2  
Príspevok Zaslal: 2008-04-19 12:43
Návrat hore  Odpovedať s citátom     

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     Založený: 19.04.2008   Príspevky: 2  
Príspevok Zaslal: 2008-04-27 05:25
Návrat hore  Odpovedať s citátom     

doug Napísal:
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

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov