why i can't use this code ? and could anyone tell me what is the correct code ?
$lfr_prfid = "profile='$log_id'";
$lfrsql = "SELECT * FROM friends WHERE user2='$log_id' AND accepted='1'";
$lfrquery = mysqli_query($db_conx, $lfrsql);
while ($lfrrow = mysqli_fetch_array($lfrquery, MYSQLI_ASSOC)) {
$lfr_id = $lfrrow["id"];
$lfr_user1 = $lfrrow["user1"];
$lfr_user2 = $lfrrow["user2"];
$lfr_prfid += " OR profile='".$lfr_user1."'";
}
the last line i wrote this ( += ) and the code doesn't work so how can i do this in another way ? so i can use this in a SELECT statement .
$psql = "SELECT * FROM posts WHERE ".$lfr_prfid." ORDER BY postdate DESC LIMIT 0,20";
$pquery = mysqli_query($db_conx, $psql);
bind_parammethod makes this safe and reliable.