SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Check if a field is in a given set

  1. #1
    SitePoint Guru DeNasio's Avatar
    Join Date
    May 2001
    Posts
    810
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Check if a field is in a given set

    Hello,

    How do you check if a field is in a given set? I thought it was like this:

    Code:
    mysql_query("UPDATE Topics SET locked='yes' WHERE account='$account' AND topicid IN [".implode(",",$_POST['locked'])."]");
    but I guess I was wrong.
    Ballot-Box.net - free polls for webmasters
    Ravelly.com - free message board
    FormLog.com - free form processor

  2. #2
    SQL Consultant silver trophybronze trophy
    SitePoint Award Recipient r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    38,455
    Mentioned
    34 Post(s)
    Tagged
    1 Thread(s)
    could you please echo the query so that we can see what mysql sees?
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    reads the ********* Crier silver trophybronze trophy SitePoint Award Recipient longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you need () not []
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast

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
  •