I'm looking for a way to replace variables place in data stored in a mysql table.
Specifically I am storing links for buttons for advertisers in a db table. Here is an example. Assume that banner_link in my table contains a value of
Hello $msg_txt
<?php
include ("config.php");
include ("opendb.php");
$msg_text = "World";
$query = "SELECT text_link, banner_link, company_name FROM advertisers order by company_name";
$result = mysql_query($query, $cxn) or die ("Couldn't execute query.");
/* Display results in a table */
echo "<table cellspacing='10' border='1' cellpadding='2'
width='100%'>";
while($row = mysql_fetch_assoc($result))
{
/* display row for each advertiser */
echo "<tr>\n";
echo " <td>{$row["banner_link"]}</td>\n
</tr>\n";
}
echo "</table>\n";
include ("closedb.php");
?>
In this example I want Hello World echoed out but what I get is Hello $msg_txt.
Any help would be appreciated.
Greg