& Symbol with PHP

Discussion in 'PHP' started by Agent_Smith, Sep 22, 2010.

  1. #1
    Hello,

    Im getting a name from the url, for instance,

    index.php?name=C.-and-G

    The "and" is then converted to a & symbol and dashes converted to spaces.

    This then uses the new name "C. & G" to select a record from mysql. However, it does not recognise the & symbol, the name in mysql is "C. & G" but returns 0 records.

    Any ideas? Thanks!
     
    Agent_Smith, Sep 22, 2010 IP
  2. axelay

    axelay Peon

    Messages:
    54
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    Can you show us the code doing the query so we can have a better look?
    So far it seems alright although I would have encoded the & when passing to a query string (lookup urlencode/urldecode on the php website)

    aXe
     
    axelay, Sep 22, 2010 IP