Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8318619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:02:18+00:00 2026-06-08T22:02:18+00:00

So my problem is this I got a code that loops trough a loggfile

  • 0

So my problem is this I got a code that loops trough a loggfile then compares them to a treestructure and then gives them a id that correspond to the id in the structure. To not get a lot of bad traffic i sort out all the 302 and above.

The problem is now that i want some specific 302s to count that have a particular pagetype in the structure. This is not a big problem as I can just match the url in the loggfile against the url in the tree structure but some loggfiles does not use friendly url while the structure is in friendly url this creates a problem but I can just match the id in the query parameter with the id in the structure. I then make a string of all the ids that match the special pagetype that I want.

The problem is this I can not get the Mysql statement to work, it looks like this.

$sqlQ1 = "SELECT `lid` FROM logfile WHERE date = '$date' AND ´query´ IN '$check'";

A example query can look like this “id=4&epslanguage=sv” so I want to check only the id=X part.

It´s a kinda easy question really im just stuck and can not get it to work, any help is appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:02:19+00:00Added an answer on June 8, 2026 at 10:02 pm

    I think your Q is: How do I extract id from that part of a line?

    “.. so I want to check only the id=X part.”

    Once you have isolated that string then you can use:

    $string = "id=4&abclang=sv";
    
    parse_str($string);
    
    echo $id; // 4
    

    EDIT
    In light of other responses:

    $strings[] = "id=4&abclang=sv";
    $strings[] = "id=45&abclang=en";
    
    $vals = array();
    
    foreach( $strings as $string){
    parse_str($string);
    $vals[] = $id ;
    }
    
    $in_clause = join(",", $vals) ;
     $sql = "SELECT lid FROM logfile WHERE something  IN ($in_clause) ";
    echo $sql; // SELECT lid FROM logfile WHERE something IN (4,45)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this code today that works for jQuery v7. The problem is that
ok i got this problem. i have this routes: (code bit change) File:/home/dotcloud/current/config/routes.js exports.routes
My Problem is the following. I got this code and i guess a corrupt
It's a really simple problem. I've got HTML code like this : <div> <img
I've got another problem in the same code... I'm getting this error: initialization method
Ive got this problem: Line 20 (LOOT_FromContainer(container) I need that to use as Invoke
I've got some UI code that looks like this: try { SomeClass classInstance =
I've got a problem with my code. It basically looks like this: someclass.hpp: class
I got this problem after deploying my web package to IIS: HTTP Error 500.19
I've got this problem for a while now and I cannot find a solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.