Aaron Cooper wrote: > Howdy folks, > > I have a bit of a weird one, and it's more to do with design than > coding of any sort. > > To keep things simple: > > We have a MySQL table called display_type. This table is used to store > config data for a range of physical devices that do certain jobs. This > table holds Min Value, Max Value, Default Value, Unit. > > The data stored in this table can pertain to many devices that work > with different sets of variables. E.G. It could be a media player, > where Min, Max and Default Vals are volume settings. It could be a > thermometer where Min, Max and Default are temperature ranges for > display purposes only. > > Because there is such a wide range of formats for this table, each > with a different way of displaying these values to the user, we also > want to store a display format for each record to use in printf or > number_format functions in the code. Not too different to how you > format numbers in Excel. > > The table in question is more of a lookup table with a finite data > collection, although it will be added to as time goes by. It is > maintained by us, and us alone (no user input will reach it) > > All the values (Min, Max, Default and Current) are stored MySQL's > decimal format with 6 decimal places. > > Any ideas on the best way of storing formatting (and later using > in PHP) masks like this? > > Oh, and and by the way, the backend is being built on the Zend > Framework if anyone is aware of a nifty way one of those libraries can > aid in this. > > Cheers > Aaron > > > Are you wanting to do the formatting in php or the database? If using mysql5 why not just use a view for each different device that needs a separate format of the data?
Rob --~--~---------~--~----~------------~-------~--~----~ NZ PHP Users Group: http://groups.google.com/group/nzphpug To post, send email to [email protected] To unsubscribe, send email to [EMAIL PROTECTED] -~----------~----~----~----~------~----~------~--~---
