0
I’m developing a system for watching movies online and wanted to know how do I make films that are in 2 categories to be listed in both categories. I’m managing to list only on the first... someone could help?
I have the table of films in my system and there is a field called category varchar(100)
.
code:
<?php
require "conexao.php";
$cat = $_GET['cat'];
$sql = "SELECT * FROM filme WHERE categoria = '$categoria' ORDER BY nome LIMIT 10";
$qr = mysql_query($sql) or die(mysql_error());
while($aux = mysql_fetch_array($qr)){
$nome = $aux['nome'];
$img = $aux['img'];
$cate = $aux['categoria'];
$sinopse = $aux['sinopse'];
$cod = $aux['id'];
print"
<div class=\"categoria\">
<ul class=\"col-md-3\">
<li><a id=\"popover\" data-trigger=\"hover\" data-toggle=\"popover\" title=\"$nome\" data-content=\"$sinopse\" href=\"watch.php?cod=$cod\"><img src=\"images/capa/$img\" title=\"$nome\" ></a></li>
<span class=\"resto2\">Hdtv</span>
<strong class=\"text text-center\">$nome</strong>
</ul>
</div>";
}
?>
There’s the code I want you to take the category and in my index I have the href
<a href="algumacoisa.php?cat=acao">
and has more categories:
<a href="algumacoisa.php?cat=aventura">
what I wanted to know and how do I list a film of 2 categories as in the example filem has the category of action and adventure. how I make it to be shown in the 2 pages of action and adventure?
I can already say that you need to review the mapping of your database... Put your code, so we can help you.
– Dherik
The category field has separate values like this
ação, aventeura, suspense
? all separated by comma?– rray
yes I inserted a separated by comma did not work after inserting without comma and did not work either but it is separated yes
– Leonardo Costa
Dherik, had already sung the stone, you better normalize that column so there are no problems, if you are interested see that question or ONLY in temporary cases see that answer
– rray
No need to put
resolvido
just accept the answer (mark the green light), see another trick of the website here and How and why to accept an answer?– rray