fj1200 Posted February 21, 2008 Share Posted February 21, 2008 I'm not a programmer and learning php. I'm modifying a simple php web app that I wrote last year that queries a MSSQL db, but on one particular page I need to present the data in a DB collumn as a row. I want to display a production board electronically as the current whiteboard gets defaced. All the data is held in a db - easy enough. The scenario is this: Production occurs on on, say machine A that is comprised of a number of units. Sometimes all 10 units will be used, other times, for example, only units 1,2,5 7 may be used. In the database, the info is held in a table and referenced as a combination of machine and unit, so m/c A Unit 2 is A02 and so on. I'm not worried about that - eay enough to split out. I have a set of columns on the page - one for each unit - that I want to have an 'X' or change the bg_colour in the table cell if that unit is to be used and to be blank if not. So: M/C JOB ORDER 1 2 3 4 5 6 7 8 9 10 A 10123 12,500 X X X X X A 10124 25,750 X X X B 12584 90,800 X X X X X X X X X X All other data displays fine, I just need some help with this bit. I'm sure an array is the way to do it and have a $UNIT[n] value. The DB table is structured: JOB_ID MACHINE UNIT 10123 A01 10123 A02 10123 A03 10123 A05 10123 A06 10124 A01 10124 A02 10124 A03 etc... Hope this is understandable! Quote Link to comment https://forums.phpfreaks.com/topic/92256-columns-to-an-array/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.