can i put more then just 1 int in where mysqli select. and can i put var in at.
$selectQuery22 = mysqli_query($db,
"SELECT * FROM `messages` WHERE `user_id` in(21,2) ORDER BY `date`DESC");
i put in where some id but i have more then one or two , can i make at working with out any intervention from me.
WHERE user_id in(21,2)
i need to put more the one id but Automatically with out writng and the ids at is in a variable , Please help me and sorry if i did not clear my point
Added from comments
$bb = $rowpro1->id;
$sess = mysqli_query($db,"SELECT * FROM fmds WHERE user_one = $bb or user_two ='$bb' ");
$user = $_GET['news'];
while ($ty = mysqli_fetch_object($sess)) {
$ided= $ty->user_two;
$ided1= $ty->user_one;
}
$selectQuery22 = mysqli_query($db,"SELECT * FROM messages WHERE user_id in(21,2) ORDER BY dateDESC");
while ($row = mysqli_fetch_array($selectQuery22)){
Second comment
$usera =mysql_real_escape_string($_SESSION['username']) ;
$selectQuery1 = mysqli_query($db,"SELECT id FROM account WHERE username = '$usera'");
if ($_SESSION[username] == true) {
$sha = mysqli_query($db,"SELECT * from account1 where username = '$usera'");
$numpro = mysqli_num_rows($sha);
}
if ($numpro == 0) {
}else{
$rowpro1 = mysqli_fetch_object($sha);
$rowpro2 = mysqli_fetch_array($sha);
$bb = $rowpro1->id;
}
$cocos = mysqli_query($db,"SELECT id from freind_req where too ='$bb'");
$num_rows = mysqli_num_rows($cocos);
?>