henryhenry Posted March 21, 2007 Share Posted March 21, 2007 Hello!Does anyone know a technique to store a reference to a variable in MySQL?I want my table to hold the name of the variable - eg $varThen I want my page to take the name and get the value from the other part of the page...eg$var="hello world"then later in the page...query result would be: "This is an interesting $var"If you print the query result to the page you would see on the final page: "This is an interesting hello world"Is this possible? Maybe it's more of a PHP question - not sure?ThanksHenry Link to comment Share on other sites More sharing options...
msd Posted April 8, 2007 Share Posted April 8, 2007 Take a look here: http://www.php.net/language.variables.variable Link to comment Share on other sites More sharing options...
shah_ankitb Posted April 10, 2007 Share Posted April 10, 2007 Please give me a code also table's Query & Describe More deeply. I am sure want to help u if i got it RIGHT. Link to comment Share on other sites More sharing options...
henryhenry Posted April 21, 2007 Author Share Posted April 21, 2007 HiI'd forgotten about this...hopefully you guys are still there to help me out Thanks!It's a bit of a theoretical question right now as I gave it a bit of a try and didn't manage it so I changed my approach. But I think it would be useful for a few things.A simple example would be:I have a heading stored in my database eg:This page is about {$title}But I want to use the same entry in the database to populate 5 pages with the following titles:This page is about SurfingThis page is about DivingThis page is about BodyBoardingThis page is about SwimmingThis page is about LivingSo the entry in the database doesn't record the actual value of $title but when you insert that entry into the page, you it would THEN look for $title and assuming it's set, then heading would alter accordingly.Hmmm... perhaps variable variables is the way forward but I can't quite see how that would do it...any thoughts?ThanksHenry Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now