This is my view page:
<?php
include 'connect/con.php';
$result = mysqli_query($con,"SELECT newsvid.id, newsvid.vidTitle, newsvid.url, newsvid.vidSD, newsvid.published, videoinformation.vidLD, videoinformation.vidYear, videoinformation.vidCity, videoinformation.vidZanr, videoinformation.vidQuality, videoinformation.vidTranslated, videoinformation.vidTime FROM newsvid, videoinformation WHERE newsvid.id = videoinformation.id ORDER BY newsvid.id DESC");
while($row = mysqli_fetch_array($result)) {
echo '<div class="id">#<a href="details.php?id='.$row['id'].'">'.$row['id'].'</a></div>';
echo "<div class=\"vidTitle\">" . $row['vidTitle'] . "</div>";
echo "<div class=\"imgCover\"><img class=\"imageCover\"src=\"" . $row['url'] . "\"></div>";
echo "<div class=\"vidSD\">" . $row['vidSD'] . "</div>";
echo "<div class=\"vidDetails\">
<table class=\"tableSD\" >
<tr><td class=\"tdBR\"><strong> Years: </strong></td><td class=\"tdB\">" . $row['vidYear'] . "</td></tr>
<tr><td class=\"tdBR\"><strong> City: </strong></td><td class=\"tdB\">". $row['vidCity'] . "</td></tr>
<tr><td class=\"tdBR\"><strong> Zanr: </strong></td><td class=\"tdB\">". $row['vidZanr'] . "</td></tr>
<tr><td class=\"tdBR\"><strong> Quality: </strong></td><td class=\"tdB\">". $row['vidQuality'] . "</td></tr>
<tr><td class=\"tdBR\"><strong> Translated: </strong></td><td class=\"tdB\">". $row['vidTranslated'] . "</td></tr>
<tr><td class=\"tdBR\"><strong> Video time: </strong></td><td class=\"tdB\">". $row['vidTime'] . "</td></tr>
</table>
</div>";
echo "<div class=\"published\"><strong>Published: </strong>" . $row['published'] . "</div>";
}
mysqli_close($con);
?>
I need a LINK in index.php page this bit "ORDER BY newsvid.id DESC
" will be changes according to the clicked link.
EG:
<div class="mainLeftCover">
<a href="#>ASC</a> |
<a href="#>DESC</a> |
</div>
If I press ASC the view.php page will show result ORDERED BY newsvid.id ASC and if I will press DESC same view.php page will show the result ORDERED BY newsvid.id DESC and so on...