I am doing a query where the choices are title=$extra1 or title=$extra2 or title=$extra3 (up to 6 extras)
I am getting the same result for all, and I ended up doing the below 6 times.
Surely there must be another way to do this to avoid the 6 queries?
PHP Code:
$extra1songsquery = $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra1' AND
active=1");
while($extra1songrow = $DB_site->fetch_array($extra1songsquery))
{
$clip1=$extra1songrow['title'];
$clip1id=$extra1songrow['songid'];
$clip1url=$extra1songrow['url'];
$extra1="<a href=\"showproduct.php?product=$product&do=main&mysong=$clip1id\">$clip1</a>";
}
$extra2songsquery = $DB_site->query("SELECT songid, title, url FROM soundtracks WHERE title='$extra2' AND
active=1");
while($extra2songrow = $DB_site->fetch_array($extra2songsquery))
{
$clip2=$extra2songrow['title'];
$clip2id=$extra2songrow['songid'];
$clip2url=$extra2songrow['url'];
$extra2="<a href=\"showproduct.php?product=$product&do=main&mysong=$clip2id\">$clip2</a>";
}