hey there I don't know if this mentioned earlier but I want to do this sql statment

$sql1 = "SELECT product FROM products WHERE cat = 2";
$sql2 = "SELECT product FROM products WHERE cat = 3";
$sql3 = "SELECT product FROM products WHERE cat = 4";

I want these three $sql combined into one so its give me the products from 3 catgeories.
is good to use CONCAT of INNER JOIN ?

Member Avatar for diafol
$sql1 = "SELECT product FROM products WHERE cat IN (2,3,4)";

or

$sql1 = "SELECT product FROM products WHERE cat = 2 OR cat = 3 OR cat = 4";

or

$sql1 = "SELECT product FROM products WHERE cat BETWEEN 2 AND 4";

or

$sql1 = "SELECT product FROM products WHERE cat >= 2 AND cat <= 4";

and a few other ways...

commented: thanks that was really helpful +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.