dimanche 1 mars 2015

I want a single image have one title with content i get from the database

Basically i want to look like this!


Here is my code



<?
$select_likes = mysql_query("SELECT * FROM users_liked WHERE post_id = '1'");
while ($row = mysql_fetch_assoc($select_likes)) {
$total_likes = $row['total_likes'];
$users_liked = $row['users_liked'];
?>
<img title='<? echo $users_liked; ?>' src='img/like.jpg'>
<?
}
?>


So if 5 users liked it gives me 5 images and the title of the user who liked, but i want to show just one image with one title which contains all 5 usernames.


Thanks in advance.


Aucun commentaire:

Enregistrer un commentaire