Note that there are some explanatory texts on larger screens.

plurals
  1. POMysql php / ajax to more database information
    primarykey
    data
    text
    <p>How do I create the images from MYSQL to be links to the information associated to them on a seperate page?</p> <p>Here's my code so far after getting the initial database connection:</p> <pre><code> $rows = mysql_num_rows($result); for($j = 0 ; $j &lt; $rows ; ++$j) { echo '&lt;img src="' . mysql_result($result, $j,'picture_url') . "class='releasesImage' id='" . mysql_fetch_row($result, $j, 'releases_id') "/&gt;" . "width= "200" height= "200"&gt; '; </code></pre> <p>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.</p> <p>The request in a seperate division on the same page needs to be something on the lines of</p> <pre><code>$sql = "SELECT * FROM releases WHERE id = 'image id'" echo '&lt;h2&gt;' . mysql_result($result, $j,'track_title') . '&lt;/h2&gt;&lt;br /&gt;'; echo '&lt;h3&gt;' . mysql_result($result, $j, 'artist') . '&lt;/h3&gt;&lt;br /&gt;'; echo 'Remixed by: &lt;ul&gt;&lt;li&gt;' . mysql_result($result, $j, 'remix1') . '&lt;/li&gt;'; echo '&lt;li&gt;' . mysql_result($result, $j, 'remix2') . '&lt;/li&gt;'; echo '&lt;li&gt;' . mysql_result($result, $j, 'remix3') . '&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;'; } mysql_close($db_server); ?&gt; </code></pre> <p>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?</p> <p>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.</p> <p>Any help would be massively helpful.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload