How do I create the images from MYSQL to be links to the information associated to them on a seperate page?
Here's my code so far after getting the initial database connection:
$rows = mysql_num_rows($result);
for($j = 0 ; $j < $rows ; ++$j)
{
echo '<img src="' . mysql_result($result, $j,'picture_url') . "class='releasesImage' id='" . mysql_fetch_row($result, $j, 'releases_id') "/>" . "width= "200" height= "200"> ';
This will get the images to layout and I'm using the database auto increment as the image ID. How do I perform an Ajax request to use the images id to load more information related to the image.
The request in a seperate division on the same page needs to be something on the lines of
$sql = "SELECT * FROM releases WHERE id = 'image id'"
echo '<h2>' . mysql_result($result, $j,'track_title') . '</h2><br />';
echo '<h3>' . mysql_result($result, $j, 'artist') . '</h3><br />';
echo 'Remixed by: <ul><li>' . mysql_result($result, $j, 'remix1') . '</li>';
echo '<li>' . mysql_result($result, $j, 'remix2') . '</li>';
echo '<li>' . mysql_result($result, $j, 'remix3') . '</li></ul><br />';
}
mysql_close($db_server);
?>
The goal being that a page full of album covers loaded from a database, once the album cover has been clicked a seperate division will load the album and artist information. Can this be done with a Jquery ajax request?
I've been looking online and I can only find examples using pre wrtten drop downs, not using content already loaded by the same database.
Any help would be massively helpful.
Thanks