"; endif; /* select the database */ $dbSelect = mssql_select_db($database, $connection); if (!$dbSelect): print "DATABASE SELECT FAIL
"; endif; $sql = " SELECT top 1 ItemCode, strTitle, strURL FROM [vwWSS-OSCommereIds-to-URL] WHERE intLanguage='2' AND [WSS ID]=".$wssID." ORDER BY ItemCode "; $result = mssql_query($sql, $connection) or die("SQL FAIL: ".mssql_get_last_message()); if ($result): $row = mssql_fetch_assoc($result); $location = $domain."/".$row["strURL"].""; /* print $location; */ else: $location = $domain."/semillas-de-cannabis"; endif; header ('HTTP/1.1 301 Moved Permanently'); header ('Location: '.$location); ?>