I'm scheduling a news feed page in PHP .
I ask your help to help me shuffle the $tagsArray
array so that the posts are not always in the same order.
Thank you in advance!
Code:
<?php
$conexao = mysqli_connect("localhost","root","","newsite");
$seguindoID= "android,Flash,iPrimePortas,";
$tagsArray = explode(',', $seguindoID);
$sizeSeguindo= count($tagsArray) -1;
for($i=0; $i<=$sizeSeguindo; $i++){
$sql = "select * from postpagina where pagina='$tagsArray[$i]'";
$query = mysqli_query($conexao, $sql);
while($linha = mysqli_fetch_assoc($query)){
$userPost = $linha['pagina'];
$post = $linha['post'];
echo "<div><label>Postado por <b>$userPost</b> - $post</label></div>";
}
}
?>