0
  1. The error messages like "Please enter your name" etc. which are part of all the user forms and fields, are these stored in a separate error message table or are they part of the main page text table? My design is each page has an ID. Each line of text on the page has an ID. And this is linked to the page and has a common group_id. So on each page load I call all the text for the group id to load all page text in 1 call. But I am not sure what the normal practice is for error messages if i should call it in this group or hit the DB again to fetch it from an error message table. I have multi-language too which are seperate tables linking to the page text table.

  2. My line of text is this. "Copyright @ 2011 ABC corp. New York, NY - USA" where ABC corp is a link to my homepage. So to make this text database driven I have 3 PK ids:
    ID 1 = Copyright @ 2011
    ID 2 = ABC corp.
    ID 3 = New York, NY - USA

Then in the code i can add the html link to ID 2. but this is a major problem for large text with in between links. I cant break a paragraph into hundreds of IDs just to fit in all the in between links. How else to do it? (Do note i have multi-lang tables too which FK to this)

Platform: codeignitor / mysql

Devin Burke
  • 13,642
  • 12
  • 55
  • 82
mike
  • 3
  • 3

1 Answers1

1

1) There is good advice on Best way of keeping locale-dependent string resources in PHP?. It's about localized strings, but still applies to your question about storing strings. You probably want to avoid the database connection and just have a PHP file "app_strings.php" (or whatever) that loads all your interface text as variables.

2) Sorry I'm not much help on the second half, I don't quite understand the question.

Community
  • 1
  • 1
Farray
  • 8,290
  • 3
  • 33
  • 37