Hi,

I have a query regarding variable parsing.

I have some text in a MySQL database in which I have included some variable
names.  Eg (but w/o quotes): "thankyou $name for registering on our web
site".

I query and use mysql_fetch_array to get the data into an associative array.
I then build a string and output it like this:
echo "blah blah ".$row["thecolumn"]." blah blah";

However, the output is simply: "blah blah thankyou $name for registering on
our web site blah blah" - i.e. $name does not get parsed.  I have tried
wrapping $name with curly brackets in the database but that doesn't help and
I have also tried using both addslashes and removeslashes on
$row["thecolumn"] and I have also tried this: echo "blah blah
$row['thecolumn'] blah blah" - again both with and without curly brackets.

Nothing seems to work.  Is what I am trying to do possible?

Thanks in advance,
James Holt
--
--------------------------------------------------------
www.jholt.co.uk : affordable business website solutions
www.htpshareware.com : software for the disorganized
--------------------------------------------------------

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to