OK - I think the issue there was it needed to be == rather than = - so that's working.
So now I'm trying to just pull the LodgeURL from the the table using the query :
mysql_select_db($database_databaseConnection, $databaseConnection);
$query_rsLodgeURL = "SELECT LodgeURL FROM lodges WHERE LodgeID = '$the_resort'";
$rsLodgeURL = mysql_query($query_rsLodgeURL, $connSafari) or die(mysql_error());
$row_rsLodgeURL = mysql_fetch_assoc($rsLodgeURL);
$totalRows_rsLodgeURL = mysql_num_rows($rsLodgeURL);
Should that be LodgeID, or id? (LodgeID is the unique ID in the table)
But I'm not sure what the syntax needs to be for the actual link in the header part at the bottom...
So the lines that were :
if ($_GET['LodgeID'] == "1") {
header ("Location: http://www.elsaskopje.com");
}
if ($_GET['LodgeID'] == "2") {
header ("Location: http://www.behobeho.com");
}
if ($_GET['LodgeID'] == "7") {
header ("Location: http://www.singita.com");
}
What should that be changed to?
Change this:
mysql_select_db($database_databaseConnection, $databaseConnection);
$query_rsLodgeURL = "SELECT LodgeURL FROM lodges WHERE LodgeID = '$the_resort'";
$rsLodgeURL = mysql_query($query_rsLodgeURL, $connSafari) or die(mysql_error());
$row_rsLodgeURL = mysql_fetch_assoc($rsLodgeURL);
$totalRows_rsLodgeURL = mysql_num_rows($rsLodgeURL);
To this:
mysql_select_db($database_databaseConnection, $databaseConnection);
$query_rsLodgeURL = sprintf("SELECT LodgeURL FROM lodges WHERE LodgeID = %s",
GetSQLValueString($the_resort, "int"));
$rsLodgeURL = mysql_query($query_rsLodgeURL, $connSafari) or die(mysql_error());
$row_rsLodgeURL = mysql_fetch_assoc($rsLodgeURL);
echo $reLodgeURL['LodgeURL']; should output the entire lodge URL like http://www.singita.com or http://www.behobeho.com etc. depending on the URL parameter for LodgeID = 2 or 7 or whatever.
Then change this:
if ($_GET['LodgeID'] == "1") {
header ("Location: http://www.elsaskopje.com");
}
if ($_GET['LodgeID'] == "2") {
header ("Location: http://www.behobeho.com");
}
if ($_GET['LodgeID'] == "7") {
header ("Location: http://www.singita.com");
}
To this:
if ($row_rsLodgeURL['LodgeURL'] != "") {
header("Location: $row_rsLodgeURL['LodgeURL']");
} else {
header ("Location: http://www.google.com");
}
Cheers! 