Query Possible?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Query Possible?

Post by AGISB »

I got a list with ID and IP adresses and page names and timestamp.

Now I want to check if a certain ip went directly form lets say index.html to registration.html

Is this possible in one query?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Yep, but that would be very resource-intensive query. Instead, just select individual sessions like this:

Code: Select all

select distinct ip from logTable;
for each $ip from above query:
  select id, pagename, timestamp from logTable where ip=$ip order by timestamp asc
Then go through the result-set in a loop and check if there were transitions you're looking for.
Post Reply