SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: mysql query

  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wink mysql query

    I have a simple question regarding queries in mysql. I am having trouble with a query such as:

    select * from table where name = 'john doe'

    Because of the space between john and doe the query does not work. The name field is a 'char' type.

    Any suggestions.

    Thanks.

  2. #2
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what do you mean by does not work

    the space should not cause any problems in your SELECT...

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help...you are correct, the space doesn't cause a problem. My PHP routine wasn't passing the space, or the characters after the space, to the query.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •