1
Good people and the following I have a photo upload that is working well, I’m just trying the problem in displaying all the photos through the for
, an image always appears only needs your own to discover where the problem is.
Code
// MOSTRA FOTOS DO POST
$result_anexo_post = mysql_query("SELECT * FROM posts_anexos WHERE post_id = '".$row_posts->id_post."' AND seccao='fotos_posts'");
$num_fotos = mysql_num_rows($result_anexo_post);
for ($i=0;$i<$num_fotos;$i++) {
$row_anexo_post = mysql_fetch_assoc($result_anexo_post);
$fotos_post = '<img src="../php/timthumb.php?src=gtm/anexos/posts_fotos/'.$row_anexo_post['id_anexo'].'.'.$row_anexo_post['tipo'].'&h=100&w=100&zc=1" alt="">';
}
In the HTML
where you should display all the images is so it gets inside an array that is then returned via ajax to list on the page.
<div style="float:left; margin:0px 5px 10px 0px;">'.$fotos_post.'</div>
That’s right settled thanks for the help after all it was a simple thing,
mysql_query
it is no longer recommended to be used because you can explain to me ?– César Sousa
The PHP community will stop supporting it, in future versions of PHP your website may no longer work.
– Hiago Souza
The correct term is deprecated.
– Hiago Souza
already this marked so I will have to research on PDO as it is the future
– César Sousa
That’s right, evolving is part of it!!! As you will be studying, look for Design Partner in PHP object orientation, and use of the Smarty class to separate HTML from your business rule.
– Hiago Souza
But PDO changes the programming structure a lot ? I want to know to be prepared if I will have to change a lot on the site ?
– César Sousa
It changes a little, but it’s nothing complex.
– Hiago Souza
Let’s go continue this discussion in chat.
– Hiago Souza