PHP Variables Stored in SQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
oewMind
Forum Newbie
Posts: 3
Joined: Fri Sep 01, 2006 7:36 am

PHP Variables Stored in SQL

Post by oewMind »

I am trying to store a standardized text into a database. I want it to store some of my php session variables so when I call it , it will display the current value.

I am storing text that looks like this:

'<?php echo $firstName; ?> Wants to send you a gift ....'

I tried storing it a couple other ways thinking I had my tags in the wrong place. Stored like that I dont even see the code, I only see 'Wants to send you a gift ...'. So I am thinking its recognizing it but dont know why it isnt printing.

I am putting it my document like this:

echo $row_gift['Description'];

I am thinking I should be trying it in an include and it might work better. So I thought echoing it in another document and trying to include it would work, but didnt.

Help please...

Thanks in advance.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Code: Select all

$firstname . ' wants to send you a gift';
You're better off, however, storing only $firstname, and then assembling the message when you output it.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You're treading on thin ice here oewMind. Duplicating your thread across three forums is often immediate, permanent ban-worthy.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
Locked