Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6135481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:29:05+00:00 2026-05-23T17:29:05+00:00

I am trying to get a variable to display, when used as part of

  • 0

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 example
my script would contain something like this:

$variable = 'cool';

The value inside of the mysql field would be something like this:

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

Here are the two queries i am working with:

$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>
';
}
}

Basically, I want to use

$model

as part of the value inside of the desc field. When

$linkDesc

is echoed, this will be part of the outcome when

$pageContent

is echoed. It should display the text along with the value of

$model

, not just display

'.$model.'

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

$linkDomain

If you read the text of the link you will clearly see my problem.

What am i missing here guys?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:29:05+00:00Added an answer on May 23, 2026 at 5:29 pm

    Dude, try to do more simple, your question is too long.
    But, based on what I understood I think that what you need is store a variable on database field like:

      "This is '" .$variable. "' wow"
    

    If true, so when you will save the value you can serialize it before save on database and unserialize when rescue from database, like this:

      "INSERT INTO may_table (field) values (" . serialize("This is '$variable' wow") . ")";
      $model = unserialize($row['field']);
    

    So when you rescue the value “$model” will return as a php variable.

    Note: I put here just a example of how you could use the serialize/unserialize php functions and not the complete script.

    I did a test and the works fine on this way:

      $c = serialize("This is '$variable' wow");
      $variable = "test";
      echo unserialize($c); //outputs This is 'teste' wow
    

    Try again please.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get the value of variable a that is inside the
I'm trying to get the value of a variable using SQL select queries. Nothing
I am trying to use a variable to get a function in a extended
I'm trying to get some code going that lets me display raw trackpad data
I'm trying to get value from dropdown box into variable and then store it.
I'm trying to get the WebBrowser control to display HTML loaded from a variable.
I am trying to get strpos to search string variable $string for the phrase
I am trying to get jquery to pick up variable that I am defining
I am trying to created nested dictionary variable like the below, But I get
I am trying to use this answer from an old post: Display image from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.