I am trying to get a variable to display, when used as part of a value inside of a mysql table.
$variable = 'cool';
MYSQL FIELD VALUE
"This is '.$variable.' wow"
When i echo this value, it displays as:
This is '.$variable.' wow
I want it to display as:
This is cool wow
What is the trick here?
@Mark sorry im new to this
$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 results.');
} else {
while($row = mysql_fetch_assoc($sql15)) {
$model = stripslashes($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 results.');
} else {
$pageContent .= '';
while($row = mysql_fetch_assoc($sql3)) {
$linkAd = ($row['link']);
$linkDesc = ($row['desc']);
$linkDomain = ($row['domain']);
$pageContent .= '
<li><a href="'.$linkAd.'" target="_tab">'.$linkDesc.' '.$linkDomain.'</a></li>
';
}
}
$model
to show up in the value of thedesc
field when$linkDesc
is echo'd – IndigoIdentity Jul 12 '11 at 18:19