Hi, im currently building a photography portfolio website for ym dissertation and i have a quick question.
The site has several categories of photos, would it be easier storing all in photos in one table and adding a album and field or storing each separate category,of photos, into its own table? I have a script which gets the photos from the database which is below, if its easier storing all the photos in one table how would i go about modifying this script to select the photos with a specific category. I hope that makes sense. thanks
<?php
require "common.php";
$q = "SELECT id, title, source FROM sports";
$result = $mysqli->query($q) or die(mysql_error($mysqli));
if ($result) {
while ($row = $result->fetch_object()) {
$title = $row->title;
$source = $row->source;
$id = $row->id;
echo "<a class='gallery' rel='usa' id='$id' alt='$title' href='img/sports/$source'> <img src='img/sports_tn/$source' /> </a> \n";
}
}
?>