storing sub script and superscript value in Mysql database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dakshayini
    New Member
    • Dec 2007
    • 16

    storing sub script and superscript value in Mysql database

    Hi all,

    i need to store data having subscript and super script like chemical equations symbols...value s in to mysql database and fetch it and display.

    for that i need to convert that text into some image and store the link of that image in the database,but not getting how to do that.

    am i thinking right or is there is any other alternative method for that plz let me knw...
    its urgent
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    If you just want to use superscript and subscript you can use the <sub> and <sup> tags of HTML to display, no images needed. See this sample (nonsense but it shows my meaning). When you display this it will show the sub- and superscripts you need.[code=html]Chemical formulas include H<SUB>2</SUB>O (water) and C<SUB>21</SUB>H<SUB>27</sub>NO (methadone).<br >
    Let <VAR>x</VAR> = <VAR>x<SUP>1</SUP></VAR> + <VAR>x<SUP>2</SUP></VAR> + ... + <VAR>x<SUP>n</SUP></VAR>. [/code]Or are you looking for something else?

    Ronald

    Comment

    • dakshayini
      New Member
      • Dec 2007
      • 16

      #3
      Originally posted by ronverdonk
      If you just want to use superscript and subscript you can use the <sub> and <sup> tags of HTML to display, no images needed. See this sample (nonsense but it shows my meaning). When you display this it will show the sub- and superscripts you need.[code=html]Chemical formulas include H<SUB>2</SUB>O (water) and C<SUB>21</SUB>H<SUB>27</sub>NO (methadone).<br >
      Let <VAR>x</VAR> = <VAR>x<SUP>1</SUP></VAR> + <VAR>x<SUP>2</SUP></VAR> + ... + <VAR>x<SUP>n</SUP></VAR>. [/code]Or are you looking for something else?

      Ronald
      Thanks for the reply sir...

      i dont know like i am going to use HTML for my front end...
      n one more thing is if i use html..then also i may need to display the chemical structure n all for that...so i think its compulsory for me to store that as an image only..and retrive the path of that image...
      so plz let me knw how to solve it..

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        You will have to code your equations, formulaes, etc. and show them on the screen.

        Then there are are 3 ways to tackle this and you won't like any of them:
        • Use a screen grabber to make an image of that part of the screen and save it (all manually).

        • Use a professional package, but those are very expensive.

        • Using PHP the only way you can take a screenshot of a webpage is to render the page : you must parse the HTML, CSS and Javascript to generate the same picture that a browser show. And there is nothing written in PHP that can do that, this is a very complex task : internet explorer doesn't even manage to properly render CSS 2)

        Ronald

        Comment

        Working...