i have already made a working script that would load previously uploaded Images (with their title, size, category etc.) into a gallery. It looks like this: https://i.stack.imgur.com/RWASu.jpg
The problem is, i made it load an image of RANDOM ID, there will be more such images after sliding right/left, and i would like to have them displayed by ID, but each other to be the NEXT ID, instead of being this same or random. How could i make it work?
Here is the script so far:
<?php
$result = mysql_query("SELECT id, rozmiar, technika, kategoria, image_time, title FROM {$table} ORDER BY RAND() LIMIT 1");
if (mysql_num_rows($result) == 0)
echo '<ul><li>Nie wgrano żadnych plików.</li>';
else
{
echo '<ul>';
while(list($id, $rozmiar, $technika, $kategoria, $image_time, $title) = mysql_fetch_row($result))
{
echo "<div class='image-frame left-image'>";
echo "<a href='".$_SERVER['PHP_SELF']."?show=$id' data-lightbox='galeria' data-title='{$title}, {$technika} | {$rozmiar}'><img width='450' src='".$_SERVER['PHP_SELF']."?show=$id'></a>";
echo "<div class='description'><p>{$technika}, {$rozmiar}</p></div></div>";
}
echo '</ul>';
}
?>
<?php
$result = mysql_query("SELECT id, rozmiar, technika, kategoria, image_time, title FROM {$table} ORDER BY RAND() LIMIT 1");
if (mysql_num_rows($result) == 0)
echo '<ul><li>Nie wgrano żadnych plików.</li>';
else
{
echo '<ul>';
while(list($id, $rozmiar, $technika, $kategoria, $image_time, $title) = mysql_fetch_row($result))
{
echo "<div class='image-frame right-image'>";
echo "<a href='".$_SERVER['PHP_SELF']."?show=$id' data-lightbox='galeria' data-title='{$title}, {$technika} | {$rozmiar}'><img width='450' src='".$_SERVER['PHP_SELF']."?show=$id'></a>";
echo "<div class='description'><p>{$technika}, {$rozmiar}</p></div></div>";
}
echo '</ul>';
}
?>
Any ideas on how may i make it into one script, that would load multiple blocks with images with ascending ID's? Would be grateful for all suggestions.