Here is my query
$qry="select * from table where colnam in ($int1, $int2)";
colname values can be 1,4,3,2
For example
if $int1=2;
I want to select 1, 2 and 3
if $int1=3;
I want to select 2, 3 and 4
Is it possible?
Re-write query as:
$qry="select * from table where colnam BETWEEN $int1-- AND $int1++ ";
No need of $int2 at all. Just assign the values 2 or 3 in $int1 only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With