I need some help in storing php variables in database
I am making a News Letter system. in which we will insert news letter data in our database and then will send to our registered users only. So in this we need to store user name ( $name ) with news letter data in database our user profile url ( $url ) in database too. as we can use them anywhere in any news letter so we need to store users profile data variables in database
what i tried
i use direct variable in mysql table data
for example
Hello $name
This is your profile url $profile_url
Now we want to store this data first in database then we will fetch it and send as news letter
But when i am trying to display this data but its showing data as its same. not covering $name with user actual name or $profil_url as user profile link
How we can do it to store php variables in database or convert php variables at run time
I guess I understand your question better this time. you could do the following, the string you retrieve from you db should be stored in $string.
$string = $DBString;
eval("\$string = \"$string\";");
echo $string;
Caution
The eval() language construct is very dangerous because it allows execution of arbitrary PHP code. Its use thus is discouraged. If you have carefully verified that there is no other option than to use this construct, pay special attention not to pass any user provided data into it without properly validating it beforehand.