displaying bulleted text

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • developing
    New Member
    • Mar 2007
    • 110

    #1

    displaying bulleted text

    hey all,

    im building a standard site that uses the get funtion to display teh user whatever they want (dynamic- linked to mysql db).


    the page using the get function has some bulleted text. what would be the best way to make these bullets dynamic?

    idead 1
    make a seperate table just for the bullets with a column for every bulleted line and use sql to display the bullets.

    OR i have the bulleted lines seperated by one line. So in the database, afer typing in one line (that needs a bullet), i hit enter twice. can i use this to create dynamic content?
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    #2
    Originally posted by developing
    hey all,

    im building a standard site that uses the get funtion to display teh user whatever they want (dynamic- linked to mysql db).


    the page using the get function has some bulleted text. what would be the best way to make these bullets dynamic?

    idead 1
    make a seperate table just for the bullets with a column for every bulleted line and use sql to display the bullets.

    OR i have the bulleted lines seperated by one line. So in the database, afer typing in one line (that needs a bullet), i hit enter twice. can i use this to create dynamic content?
    Hi developing,

    I have worked on a database that is used to produce web pages with dynamic content and I have tended to store the required formating in the database. So in the example you gave this information would go in a BLOB complete with HTML tags so that when it is selected the php can simply echo it.

    The downside to this is that whenever information is entered into the database you have to ensure the required formatting is entered. For my project this was a small trade-off for ease of development and speed of loading the public facing pages.

    Another idea would be to format the data with something, as you suggested but perhaps with a visible character such '||'. Yuo can then take this string from the DB and explode it into an array based on the presence of '||' (or some other character that won'tappear in the data itself). Then loop through the array with a foreach() and echo each item in the array within the bulleted list.

    Have a play around with these ideas and if you get stuck then please post back some code with your questions and I'll do my best to help.

    Cheers
    nathj

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, developing.

      You'll really like CSS's list-style-type property.

      Comment

      • developing
        New Member
        • Mar 2007
        • 110

        #4
        Originally posted by pbmods
        Heya, developing.

        You'll really like CSS's list-style-type property.

        never though of putting code in db! that sounds like a good idea....gonna go with that for now...then i will update up css to make a more integral solution

        Comment

        • nathj
          Recognized Expert Contributor
          • May 2007
          • 937

          #5
          Originally posted by developing
          never though of putting code in db! that sounds like a good idea....gonna go with that for now...then i will update up css to make a more integral solution
          I used to develop desktop apps and we did all the time for the more dynamic sections of the application.

          I'm glad it helped you out.

          Cheers
          nathj

          Comment

          Working...