Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post

    2 WHERE declarations?

    Can I use 2 where declarations?

    Heres an example. Now the && I don't know if it works. How should I go about this? I want to get an artist with the name $artist, that is active yes.
    Code:
    $getfiles = mysql_query("SELECT * FROM `artists` WHERE `name`='$artist' && `active`='y'");

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    You can use it like that, but I'm not sure if && works, I've always used AND

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    I believe && and || will work but you should use AND and OR for clarity.

  • #4
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post
    ohhh. duhhhhhh. I knew this. darn it.

    Thanks guys rep to both.


  •  

    Posting Permissions

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