PHP/MYSQL - Possible to use php variable inside of mysql field value?

X_h4ck3r_X

New Member
I am trying to get a variable to display, when used as part of a value inside of a mysql table.To explain my problem, i am going to use a simple examplemy script would contain something like this:\[code\]$variable = 'cool';\[/code\]The value inside of the mysql field would be something like this:\[code\]This is '.$variable.' wow\[/code\]When i echo this value, it displays as:\[code\]This is '.$variable.' wow\[/code\]I want it to display as:\[code\]This is cool wow\[/code\]Here are the two queries i am working with:\[code\]$linkQuery3 = 'SELECT model FROM models WHERE model_id = "'.$pageModel.'"';$sql15 = mysql_query($linkQuery3) or die(mysql_error());if (mysql_num_rows($sql15) == 0) {die('No model results.');} else {while($row = mysql_fetch_assoc($sql15)) {$model = ($row['model']);}}$linkQuery2 = 'SELECT l.link , l.desc , l.domId , d.domain FROM links l INNER JOIN domains d ON d.domId = l.domId WHERE l.catId="'.$pageCat.'" && (l.modId="1" || l.modId="'.$pageModel.'")ORDER BY domain';$sql3 = mysql_query($linkQuery2) or die(mysql_error());if (mysql_num_rows($sql3) == 0) {die('No link results.');} else {$pageContent .= '';while($row = mysql_fetch_assoc($sql3)) {$linkAd = stripslashes($row['link']);$linkDesc = ($row['desc']);$linkDomain = ($row['domain']);$pageContent .= ' <li><a href="'.$linkAd.'" target="_tab">'.$linkDesc.' '.$linkDomain.'</a></li>';}}\[/code\]Basically, I want to use\[code\]$model\[/code\]as part of the value inside of the desc field. When\[code\]$linkDesc\[/code\]is echoed, this will be part of the outcome when\[code\]$pageContent\[/code\]is echoed. It should display the text along with the value of\[code\]$model\[/code\], not just display\[code\]'.$model.'\[/code\]As it currently does...To view an example of this, you can check out http://www.free4blackberry.com/downloads/9800/apps.php it is one of my pages on my website, near the bottom of the page, you will see a list of links. The 7th one from the bottom links to en.softonic as\[code\]$linkDomain\[/code\]If you read the text of the link you will clearly see my problem.What am i missing here guys?
 
Top