0
I’m programming a page of feed on news in PHP.
I ask for your help to help me shuffle the array $tagsArray
for posts not always stay 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>";
}
}
?>
It worked perfectly too, thank you.
– iPrimePortas