Hi everybody!
I'm trying to create 2 image buttons (like,dislike). When they are submitted, it should be run a query for like/dislike a definite song. My code is:
<?php
$table = mysqli_query($mysqli,"SELECT song_id, song_name, janr_name, singers.names FROM `songs` INNER JOIN `singers` ON songs.singer_id = singers.singer_id
INNER JOIN `janr_songs` WHERE janr_songs.janr_id = songs.janr_id ");
$row = mysqli_fetch_array($table);
{
echo "<table border='1' >";
echo "<tr><th>№</th><th>Song</th><th>Artist</th><th>Song genre</th><th>Likes</th><th>Dislikes</th><th>LIKED</th><th>DISLIKED</th></tr>";
while($row = mysqli_fetch_array($table))
{
echo "<tr><td>".$row['song_id']."</td><td>".$row['song_name']."</td><td>".$row['names']."</td><td>".$row['janr_name']."</td><td>"
.$row['likes']."</td><td>".$row['dislikes']."</td>;"; echo "<th><input type='image' name='submit' value='like' src='like.jpg'></th>;
"; echo "<th><input type='image' name='submit' value='dislike' id='".$row['song_id']. "' src='2.jpg'></th>;</tr>";
} "<br>";
echo "</table>";"<br>";
}
This code doesn't work. Image buttons are set and they appear, but there is no functionality. If the buttons are not in the table, they work. Where is the mistake? :)