duklaprague;10970497 wrote:Should that be LodgeID, or id? (LodgeID is the unique ID in the table)
You should always use the name of the field, so in this case LodgeID.
When using mysql_fetch_assoc, I normally tend to select everything from the row, in this case it would mean changing it to:
$query_rsLodgeURL = "SELECT * FROM lodges WHERE LodgeID = '$the_resort'";
That way should you need to pickup anything further from the table, you dont need a 2nd query, you can just reference each field:
$row_rsLodgeURL['fieldname']
Edit: Forgot the 2nd question
duklaprague;10970497 wrote: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?
$url = $row_rsLodgeURL['LodgeURL'];
header("Location: '$url'");
Should work fine, however if you plan, or currently uses PHP sessions, you can't modify the headers as they'll already have been sent, I tend to use a meta refresh redirect.
<meta http-equiv="REFRESH" content="0; url=<?php echo $url; ?>">
Hope that helps a bit
James