Re: Store a variable name in a database field.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Most likely you are using some template system that require using of
{{whatever}} as template varibles.

if you want to change {{whatever}} to something else, maybe you should
configure your template processing as well, just let it not  to find
{{whatever}} but the pattern you prefered, and also replace
{{whatever}} with that pattern.

another tip, if you want to use `$' as literal , i.e. not
interpretered by php engine, quote the string with single quote.
like this:
  $str_val='$something';
, or like this:
  $str_val="\$something";
in both case, you will get a literal sting `$something'.


On 10/11/05, Liam Delahunty <liamvictor@xxxxxxxxx> wrote:
> I'm sure this is a pretty basic question, but I have searched for a
> decent answer and can't find one.
>
> I have a client that want to be able to write newsletters
> (newsleters_tbl.email_body) and use fields from his contact table, so
> as we grind through the contact list for newsletters subscribers it
> may pull out $first_name, or $last_name, or perhaps the address and so
> on, and send an individual email and have it in the $email_body field
> from another table.
>
> $email_body is a free form text field, and he wants to be able to type
> in anything he desires and have it pulled from the contact table.
>
> I've tried with and without addslashes, and htmlentities. Is there a
> solution or I will I have to resort to getting him to use
> {{$first_name}} etc.
>
> Lastly, if I have to use {{whatever}} then what's the reason I can't
> use $field_name in the database?
>
> --
> Kind regards,
> Liam Delahunty
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux