Reply to Re: [PHP] Store a variable name in a database field.

Your name:

Reply:


Posted by "Richard Lynch" on 10/10/05 23:35

On Mon, October 10, 2005 12:17 pm, Liam Delahunty 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?

There's no reason why you can't do what you are trying to do...

But you'd have to show us some code to give us any idea why it's "not
working"

Right now, all we can say is: It should work just fine.

You don't have to use {{$whatever}}

You could use [first_name] or {first_name} or ^first_name^ or whatever
you want.

But you ARE going to have to do some text processing to translate.

You *CAN* make it just match up whatever he types with whatever field
name you've got, but again, without seeing the code you thought should
work, we've got no idea what you did wrong.

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация