mysql: Can I use two "where"s? Like, "SELECT * FROM table WHERE something and something"?
Posted
by KeriLynn
on Stack Overflow
See other posts from Stack Overflow
or by KeriLynn
Published on 2010-05-02T17:29:52Z
Indexed on
2010/05/02
17:38 UTC
Read the original article
Hit count: 142
I have a table with my products and I'm trying to write a page that would pull bracelets with certain colors from the database. So here's what I have right now (in php):
$query = "SELECT * FROM products WHERE (products.colors LIKE '%black%')";
But I only want to select rows where the value for the column "category" equals "bracelet".
I've tried a few different things, but I keep getting warnings and errors. I appreciate any help you can give, thank you!
© Stack Overflow or respective owner