Search box not filtering by session variable

Posted on 2005-05-01
Last Modified: 2006-11-18
I hav  a search box in a form which is working, except it is not filtering by a search variable.  I am pretty confident the sql is correct.  I do have session_start() at the top of the page and the session vars are definitely working on that page.

I use LIKE to filter the records (which is working) and I also have a WHERE it is equal to a session variable.  I am used to filter records by sessions vars as I do this a lot.

When I press ENTER key I was hoping it would just give everything equal to the session var, but it returns all records in the table.

I would be really happy to get a solution to this.

Question by:debbieau1
    LVL 32

    Accepted Solution

    show us your query statement.
    LVL 1

    Author Comment

    It seems it just my query.

    Thanks anyway.
    LVL 32

    Expert Comment

    Did my comment helped !?
    If not, please tell me - I'll PAQ the question and refund the points.
    LVL 1

    Author Comment

    Yes it did thanks.  I thought it wasn't the query but after your comments, I tried a more simple query and it  did work (using sessions vars).    I wasn't sure if there was some problem using session vars with forms.


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now