0
I am trying to make a query in the database in 2 tables and pull the data to page with a condition would be this if the id_noticia of one table equals the id of the other when clicking on the image or name will redirect to the news page according to the id however working would like a help if possible
<?php
$pagCorrente = 1;
if(isset($_GET['pag'])){
$pagCorrente = (int)$_GET['pag'];
}
$mostrar = 10;
$pagCorrente = $pagCorrente * $mostrar - $mostrar;
$sqlTotal = "SELECT count(id) as total FROM noticia0;";
$ex = $conexao->query($sqlTotal);
$total = mysqli_fetch_object($ex);
$total = $total->total;
$quantPages = ceil($total / $mostrar);
$sql = " SELECT COUNT(*) FROM noticia0 n, noticia nn
WHERE n.id_noticia = nn.id
ORDER BY n.id desc LIMIT $pagCorrente,$mostrar";
$wx = $conexao->query($sql);
while($linha = mysqli_fetch_object($wx)){
?>
<div class='div0'>
<a href="<?php echo SITE;?>noticia3.php?id=<?php echo $linha->id; ?>">
<div class='pa'>
<img src='<?php echo SITE . 'php/upload/' . $linha->imagen2;?>' />
</div>
<div class='po'>
<p>
<br><?php echo $linha->titulo;?></br>
<br><?php echo $linha->sinopse;?></br>
I’ve already solved vlw man.
– Rafael Passos