spent the whole day, but fixed for anyone whos got a similar problem

PHP Code:
<?php

include("dbconnect.php");

$prod $_GET['prod'];
//$view = $_GET['view'];
if ($view==null){$view='A';};

$query0 "SELECT * FROM products WHERE productID='$prod'";
$result0 mysql_query($query0) or die (mysql_error());
$row0 mysql_fetch_array($result0);

$item $row0['itemName'];
//$newid = $row0['id'];
$fabricName $row0['fabricName'];
$str3 = ($row0['productID']);
$str6 = ($row0['productID']);
$three substr($prod03);
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/koza_main.css" rel="stylesheet" type="text/css" />
<link href="css/koza_product.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">

<?php
 
if ($three == "RET") {
    echo 
"<div id='productImgRetreat'><img src='assets/main_img/";
 } else {
    echo 
"<div id='productImg'><img src='assets/main_img/";
 }
echo 
$view."_";
echo 
$row0['productID'];
echo 
".jpg'/></div>";

?>

<div id="productDescriptDiv">
<?php

$last 
substr($str3, -2);
echo 
"\n<div id='colorwayDiv'>\n<ul>\n";

echo
"<li><a href='product_demo.php?prod=";//<<<<< fixed
$swatch_1 substr($str606)."_dc";
echo 
$swatch_1;
echo 
"&id=";

$query1 "SELECT * FROM products WHERE productID='$swatch_1'";
$result1 mysql_query($query1) or die (mysql_error());
$row1 mysql_fetch_array($result1);
echo 
$row1['id'];

echo
"'><img src='img/swatch/A_retreat.jpg' width='30' height='30' /></a></li>\n";

echo
"<li><a href='product_demo.php?prod=";//<<<<< fixed
$swatch_2 =  substr($str606)."_do";
echo 
$swatch_2;
echo 
"&id=";
$query2 "SELECT * FROM products WHERE productID='$swatch_2'";
$result2 mysql_query($query2) or die (mysql_error());
$row2 mysql_fetch_array($result2);
echo 
$row2['id'];

echo
"'><img src='img/swatch/B_retreat.jpg' width='30' height='30' /></a></li>\n";

echo
"<li><a href='product_demo.php?prod=";//<<<<< fixed
$swatch_3 substr($str606)."_pc";
echo 
$swatch_3;
echo 
"&id=";
$query3 "SELECT * FROM products WHERE productID='$swatch_3'";
$result3 mysql_query($query3) or die (mysql_error());
$row3 mysql_fetch_array($result3);
echo 
$row1['id'];

echo
"'><img src='img/swatch/C_retreat.jpg' width='30' height='30' /></a></li>\n";

echo
"<li><a href='product_demo.php?prod=";//<<<<< fixed
$swatch_4 =  substr($str606)."_po";
echo 
$swatch_4;
echo 
"&id=";
$query4 "SELECT * FROM products WHERE productID='$swatch_4'";
$result4 mysql_query($query4) or die (mysql_error());
$row4 mysql_fetch_array($result4);
echo 
$row4['id'];

echo
"'><img src='img/swatch/D_retreat.jpg' width='30' height='30' /></a></li>\n";
echo 
"</ul>\n</div>\n";

?>
</div>
    
</div>
    


</body>
</html>