Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use IN statement using array in Mysql

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 325
    Comment on it

    Hello reader's! If you have an array with multiple values to match with database coloumn. Then you can use IN statement in mysql but you have to explode the array first. let's see the exampkle below:-

    $findIN= implode(',', $YourArray); // first you need to explode the array in comma seperated
    

    Now th Mysql query will go like this:-

    SELECT * FROM galleries WHERE id IN ( $findIN)
    

    The print of this query will like this

    SELECT * FROM galleries WHERE id IN ( 23,24,25,25....)
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: