$prods = @$_GET['prod']; // Current Category ID
$sql="SELECT pSection from products WHERE pID= '" . $prods . "' ";
$query = @mysql_query($sql) or die('
Error Fetching Details: ' . mysql_error() . '
');
$result = @mysql_fetch_array($query);
@mysql_free_result($query);
$pSection = $result['pSection']; // Holds the top category ID
$sql2="SELECT * from products WHERE pSection= '" . $pSection . "' AND pID!= '" . $prods . "' ORDER BY RAND() LIMIT 0,3";
$query2 = @mysql_query($sql2) or die('