I have this constant and a Db query var attached to it - like so ->
U_GAME_LINK.$ID
and I want to use just the constant without the $ID because I want to be able to switch it with some other data?
This is what I currently have.
But This -> ID=$ID added to it doesn't work no matter how I try to qualify it and just keeps coming back empty!
Question: Can it be done?
This is the whole section so that you can see where I'm coming from and why the question - Because IF I ever add SEO the CONSTANT will need to hold the SEO string instead?
$stmt = $database->prepare("SELECT ID FROM " . GAMES_TABLE . " WHERE active=1 ORDER BY RAND() LIMIT 50");
$stmt->execute();
$result = $stmt->fetchAll();
foreach($result as $row)
{
$ID = intval($row['ID']);
if(empty($row)){/*Do Nothing*/}else{
echo'<url>
<loc>'.cleanMAP(U_GAME_LINK.$ID).'</loc>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>';
}
}
$stmt->execute();
$result = $stmt->fetchAll();
foreach($result as $row)
{
$ID = intval($row['ID']);
if(empty($row)){/*Do Nothing*/}else{
echo'<url>
<loc>'.cleanMAP(U_GAME_LINK.$ID).'</loc>
<changefreq>always</changefreq>
<priority>0.8</priority>
</url>';
}
}