Hi All,
Need some help here; this should be pretty basic but it's been a while since I've done anything PHP related and I can't think how to do this!
I'm working on a personal portfolio site, and at present I have a grid that pulls data from my SQL database.
Each cell in the grid has a video thumbnail, the video title and assorted information.
What I'm looking to do is when a thumbnail or the title is clicked the page changes to a default video page which would then be passed the info of the clicked video and only pull that record from the database:
So for example, there might be video1, video2, video3 in the grid, but when the thumb is clicked it loads up a videos page containing the clicked video.
I could do this by creating a static page for each video that only pulls the record, but instead of having 5-10 different pages I'd like to only have one.
The other thing I would like to happen is that the video page be directly linkable with a particular video...
The code for my grid page is as follows:
PHP Code:
<?php
$data = mysql_query("SELECT * FROM video WHERE type = 'Promo' ORDER BY added DESC") or die(mysql_error());
$i = 0;
echo "<table class='griddy'>";
while($info = mysql_fetch_array( $data )) {
if($i % 3 === 0) echo "\n<tr>";
echo "<td>";
echo "<img class='still' src='../video/images/{$info['still']}' width='249px' height='148px' />";
echo "<div class='title'>{$info['title']}</div>";
echo "<div class='subtitle'>{$info['subtitle']}</div>";
echo "</td>";
if($i % 3 === 2) echo "</tr>";
$i++;
}
if($i % 3 > 0) echo "</tr>";
echo "</table>";
Any help would be appreciated!
|