php - Is a foreach array the best choice to change sql column names on my web page? -


okay building website using php , mysql.

here issue:

some of columns in database such things us, darke, , year2010. many of these column names placed in drop down boxes users can collect data. however, instead, names united states, darke county (oh), , 2010 example. using bunch of arrays 1 below change values.
$arraylocation = array('darke' => 'darke county (oh)');

then, use foreach ($array $let=>$word) array access names want display on web page.

is best way go changing values of column names? can't think of way go this. appreciated.

values can vary entity should stored in row, not column:

user attribute value 1    country   1    county    darke 1    year      year2010

this eliminate need rename columns. if want normalize values contained in columns, can use mapping table:

old       new        united states darke     darke county (oh) year2010  2010 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -