Jump to content

Debbie-Leigh

Members
  • Posts

    38
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://Quick-Computer-Solutions.com

Profile Information

  • Gender
    Not Telling
  • Location
    Bristol, England

Debbie-Leigh's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I'm trying to extract start and end dates as the delimiters of different periods. I would like them to be on the same row, but I can't figure out how to do it. The query I'm using is: -- This select gets the start and end dates, but on different rows SELECT date AS start_date , date_sub(date, interval 1 second) AS end_date FROM log WHERE date(date) >= '2013-06-10 00:00:00' AND date(date) < '2013-06-16 23:59:59' AND type in (1,2,3) GROUP BY date(date), type UNION -- This next one gets the end date for the last date in the period SELECT date_sub(date, interval 1 second) AS end_date , date from ( SELECT date FROM log WHERE date(date) > '2013-06-16 23:59:59' AND type IN (1,2,3) GROUP BY date(date), type LIMIT 1 ) AS next_one ORDER BY start_date An example of the data I'm working with is: date type 2013-06-06 13:05:44 1 2013-06-13 15:34:45 2 2013-06-13 15:31:08 1 2013-06-20 13:10:32 1 2013-06-27 14:05:16 1 2013-07-04 13:58:14 1 The result I'm currently getting is: start_date end_date 2013-06-13 15:31:08 2013-06-13 15:31:07 2013-06-13 15:34:45 2013-06-13 15:34:44 2013-06-20 13:10:31 2013-06-20 13:10:32 So now the end date for row 1 is in row 2 and the one for row 2 is in row 3 etc. Does anyone know of a technique to get the end date in row 2 to appear in row 1 i.e. against the one it relates to? Debbie
  2. Hi, Has anyone else run foul of the IP loopback restriction rule that shared server hosting companies seem to have been implementing? I've been told by my hosting company that it's to stop programming loops from occurring, but IMHO, there are far more common ways to create coding loops etc. that could slow a server down than calling a program on another website on the same server, which then calls back to the same program on the originating website. It seems to me that this one rule can end up preventing a lot of quite legitimate web programming from happening, unnecessarily. For example, you may want to park a domain on a sub-domain, which could then call a module on the main domain to retrieve some database info for display, which you would quite legitimately need to use the main domain's full url for, instead of either a relative url or a full path url - not with this rule. Or you might provide a service that other websites (which could be owned by you or other people) could call from code to retrieve information to display on their pages. With the loopback rule in place, if any of the calling websites reside on the same web server as the called website, which is entirely possible with the larger hosting companies, then this won't be allowed either. Of course, with enough thought, work arounds can always be found, but it just seems to me that this is an unnecessary rule too far. Does anyone know how this rule came into being (e.g. was it a theoretical problem dreamt up by an academician or a real problem experienced by a hosting company) and why the hosting companies seem to be so fixated on it, when, IMHO, it is a rule that can cause far more problems than it solves? Debbie
×
×
  • 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.