AFreeBreather Posted December 26, 2012 Share Posted December 26, 2012 Hey all I'm new here - this is my first post. I've been tasked by my boss' boss to design a dashboard for our company. The development is coming along reasonably well so far, considering I've got minimal PHP and mysql experience, but I've hit a road block this rainy afternoon and request the help of the php freaks community. Here's a look at the data I've got: (it's all in csv format) 19-Dec,5:12 AM,EW SCRIPPS ,561-718-5959,200,0:02:00,Incoming call forward 19-Dec,4:54 AM,EW SCRIPPS ,561-718-5959,200,0:14:57,Incoming call forward 15-Dec,3:37 PM,CHANNEL 9 AUSTR ,213-709-4290,200,0:02:34,Incoming call forward 15-Dec,8:02 AM,Unavailable ,97440158274,200,0:01:14,Incoming call forward I want to pull the dates from the database, trim off the day, stick the months that exist into an array, array_unique() that array, and foreach the new array so that it spits out a nice html check box for every month that exists in the database. I've got no code for this, yet, and I'm not even sure of where to begin. What's the best way to trim off the day from the dates? Is putting it in an array the best method? I know I'm guilty of the #1 forum sin (I didn't use the search function) so if anyone knows of a previous forum post like this point it my way. Thanks so much for your help! Quote Link to comment https://forums.phpfreaks.com/topic/272381-first-post/ Share on other sites More sharing options...
trq Posted December 26, 2012 Share Posted December 26, 2012 Is there a particular reason your storing this data in csv format? I would try and store each of these values in there own database column if I were you. Quote Link to comment https://forums.phpfreaks.com/topic/272381-first-post/#findComment-1401365 Share on other sites More sharing options...
AFreeBreather Posted December 26, 2012 Author Share Posted December 26, 2012 CSV is the format they're given to me in - as far as how they're being stored my table is organized like this: Date,Time,Caller ID,Originating Number,Number Called,Length,Comments Quote Link to comment https://forums.phpfreaks.com/topic/272381-first-post/#findComment-1401368 Share on other sites More sharing options...
trq Posted December 26, 2012 Share Posted December 26, 2012 So, are they being stored in csv format or are you actually splitting them before import to database like your database schema suggests? Quote Link to comment https://forums.phpfreaks.com/topic/272381-first-post/#findComment-1401370 Share on other sites More sharing options...
AFreeBreather Posted December 26, 2012 Author Share Posted December 26, 2012 i'm splitting them up into different columns in the same table. Quote Link to comment https://forums.phpfreaks.com/topic/272381-first-post/#findComment-1401371 Share on other sites More sharing options...
Adam Posted January 2, 2013 Share Posted January 2, 2013 I think it's difficult to understand what you're saying because "table" is a database term. Do you have the data within a CSV file, or within a database table? Or is it both? If both, is the CSV file created from the database table, or the other way round? Do you have access to both? Quote Link to comment https://forums.phpfreaks.com/topic/272381-first-post/#findComment-1402738 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.