0
I need to go to the database to find the image and show it in each <li> </li>
But I needed to make it automatic, because there are many photos, there is some way?
<div id="wrapper">
<div id="carousel" class="carousel">
<div class="call-to-content wow fadeInUp">
<h3>fileira 1</h3>
</div>
<a class="nav prev" href="#"></a>
<div class="carousel_items_holder">
<ul class="carousel_items">
<li>
<a href="#">
<?php
$img=mysql_query("SELECT * FROM arquivo WHERE id_pessoa = 1 ORDER BY visu DESC limit 0,1 ")
or die("Impossível executar a query");
$nome=mysql_query("SELECT nome, id_pessoa FROM arquivo WHERE id_pessoa = 1
ORDER BY visu DESC limit 0,1") or die("Impossível executar a query");
while($row=mysql_fetch_object($img)) {
echo "<img src='getImagem.php?PicNum=$row->codigo' \">";
}
while($row=mysql_fetch_array($nome)) {
$c_nome = $row["nome"];
$c_id = $row["id_pessoa"];
}
?>
</a>
<div class="center">
<p>
<?php
echo "<a href='perfil.php?id=$c_id'> $c_nome </a>";
?>
</p>
</div>
</li>
<a class="nav next" href="#"></a>
</div>
</div>
Connected file
<?php
$host = "localhost";
$username = "root";
$password = "";
$db = "imagem";
$link = mysqli_connect($host,$username,$password) or die("Impossível conectar ao banco.");
@mysqli_select_db($db) or die("Impossível conectar ao banco");
?>
With this code above, I enter manually, but needed automatic, has some way?
this giving error in my connection file, from a pf look, I will leave in question it
– Guilherme
did not work, it does not display anything, but if I change to mysql and with my connection code, it works, there is something wrong in this part of mysqli
– Guilherme
was missing in the mysql_fetch_array, vc n put mysqli, it worked, thanks
– Guilherme
ss, I understood is q in your code you put mysql, then I arranged for mysqli
– Guilherme
@Guilhermefelipesimão our vacilei, sorry :)
– Guilherme Nascimento
haha alright, I’m having a problem in another my Carousel, I need to limit it to display only 4 img of the highest values. <? php $result = mysqli_query($link,'SELECT code FROM ORDER file BY visu DESC limit 0,4'); ? > I used the limit, but it worked, it does not display correctly inside the Carousel
– Guilherme
@Guilhermefelipesimão is not missing 2 columns? Try so
$resultado = mysqli_query($link, 'SELECT nome, id_pessoa, codigo FROM arquivo ORDER BY visu DESC LIMIT 4');
– Guilherme Nascimento
is another code q I’m having problems, yours worked out. I tried LIMIT 4, it displayed 4 only q one under the other and not inside the side Carousel sludge.
– Guilherme
@Guilhermefelipesimão vc must have touched the HTML, or your Carousel is not working.
– Guilherme Nascimento
I create another question with the new code, or I can edit this question here ?
– Guilherme
Do not need, open the page by firefox or Chrome, press Ctrl+U, will appear the source code generated in HTML only, copy everything and paste in http://pastebin.com and send it to me.
– Guilherme Nascimento
http://pastebin.com/8DYQ6SMG here
– Guilherme
@Guilhermefelipesimão what I said? I said "open the page by firefox Chrome and get the generated HTML", you sent me PHP. PHP doesn’t exactly help the result after you access it through your browser. Another thing, you put link inside link and already changed all the HTML, no longer has anything to do with the answer here, so there is no way to solve, do the following just send me the generated source code.
– Guilherme Nascimento
@Guilhermefelipesimão looking here, you again spoiled (with the pardon of the word) the HTML, has tag without close and link inside link, and what should be inside the WHILE vc put out. You’re in trouble again.
– Guilherme Nascimento
And I’m still learning =/. Sorry, Agra is the generated html link. http://pastebin.com/fTtsbtn2
– Guilherme