MySQL LIKE code not working in safari browser

Discussion in 'PHP' started by AimyThomas, Sep 12, 2012.

  1. AimyThomas

    AimyThomas Banned

    Joined:
    Aug 28, 2012
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    I am looking for database

    PHP Code:

    SELECT * FROM table_name WHERE event LIKE '%" . $search . "%' OR date LIKE '%”. $search . "%'

    This works fine in Firefox and in IE, but when i try it in safari, it seems to pull up the right results but then straight away changes and gives me all the results from the table. I am sure it has soomething to do with the LIKE operator because when i tried

    This script works fine in Firefox and in Chrom, but when i try it in safari browser, it seems to pull up the right results but then as the crow flies away changes and gives me all the results from the table.

    I am sure it has something to do with the LIKE coad because when i tried

    SELECT * FROM table_name WHERE date = (the date i was trying to search for)

    Kindly provide me solutions

    Thanks in advance
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Server side code is not depended on what browser it request the code?

    It is like asking my car does not start because it does not have wheels but then engine is independent of wheels you have in car and though engine cannot run without wheels it does not mean it cannot be given ignition.

    So if you think that it is because of Safari, your code is not getting executed, I think you have a long way to go before you understand where the problem is. Once you know where the problem is, you can think about how to solve it.
     
    AimyThomas likes this.
  3. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    http://zontek.zzl.org
    the problem can be simply a browser error of sending the POST/GET data if the search string is user input
    because some browsers send the content of a header different than the others
    best would be to standardize your input, that is make it according to the common rules so that all the browsers aggree

    if you post some more code it would be helpful
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice