Results 1 to 6 of 6

Thread: [RESOLVED] Easy SQL problem

Threaded View

  1. #1

    Thread Starter
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Resolved [RESOLVED] Easy SQL problem

    im trying to search a table based on fname and sname fields

    PHP Code:
    $sql "SELECT * FROM members WHERE fname, sname LIKE '%$search%'"
    the above gives me a mysql error. but the following works when I search just the fname field

    PHP Code:
    $sql "SELECT * FROM members WHERE fname LIKE '%$search%'"
    anyone know the SQL syntax for searching more than one field?
    Last edited by the182guy; Mar 23rd, 2006 at 09:49 AM.
    Chris

Posting Permissions

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



Click Here to Expand Forum to Full Width