Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

iwpg's Achievements


Member (2/5)



  1. Thank you Barand, this is a great solution. Problem solved. I certainly appreciate it!
  2. Hi Benanamen, I need this data to use with highCharts.js, and will plot the data by month. So for example: 2016-05 Revenue: $20 2016-08 Revenue: $10 2016-11 Revenue: $50 How can I populate the empty data where no month exists in between? To chart this out in a way that makes sense, I need this: 2016-05 Revenue: $20 2016-06 Revenue: $0 2016-07 Revenue: $0 2016-08 Revenue: $10 2016-09 Revenue: $0 2016-10 Revenue: $0 2016-11 Revenue: $50 2016-12 Revenue: $0 // This month, or months after last pulled record up until now The records are coming from traffic to a website. There are 350,000 original database rows for traffic sources. I am trying to collect archived info on a monthly level. I hope that this clarifies my original post. 2016-05 Revenue: $20
  3. I have several hundred thousand records that will add a monthly db row if new data exists. I plan on working this info into a chart, but I see no reason to add values that contain 0. For 350,000 records, doing it this way reduces new monthly records to about 8,500, vs 350,000 - a huge performance improvement if this is possible. I figured that an array will help solve this. For example, looping over the data in SQL, will return something like: while ($r = $result->fetch_assoc()){ $id[] = $r["id"]; $revenue[] = $r["revenue"]; // Revenue for example $date[] = $r["date"]; // 2016-07 } So, the result will have the dates, id's and revenue stored as an array. Using ksort() will sort the dates, however is there a plausible way to add missing dates (that have 0 values)? Sorry for not being more clear, this is the best way I could describe this. I thank you for your help. DB storage is limited and expensive, and this is a critical step on the long term project.
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.