0
I’m working on a project to learn about PHP, and at the moment I stopped to make a link access the bank and bring everything that has its same value or id...
<?php
$generos = explode(',', $post['genero']);
foreach ($generos as $categ){
$dbCheck = DBRead('generos', "WHERE id ='". $categ . "'");
?>
<a href="index.php?catalogo=<?php @$categ['id']; ?>"><?php echo $dbCheck[0]['genero']; ?></a>
<?php
if (isset($_GET['catalogo'])) {
$catalogo = $_GET['catalogo'];
$dadoCat = DBRead('posts', "WHERE status = 1 AND genero = '".$categ."' ORDER BY data DESC");
}
}
?>
In this case the $dbCheck[0]['genero'];
is returning me the Genre that has registered to this video.
As soon as the value is returned to the screen, a link is generated in it so that when clicking bring all videos of the same genre
I’m at the beginning of learning, so I couldn’t do many tests.
I didn’t get it right ... the problem is that the link is mounted without id? avoid using arrobas
– rray
@rray genero are values returned from the database, for user they will be links, and when clicking it filters all records with the same gender. Click Action, return all action on index;
– Henrique Silva
the link is mounted correctly?
$dbCheck[0]['genero']
pq is indexed to zero?– rray
My dear your question made me find the mistake! Thank you
– Henrique Silva