How to save math equations to database..?

My website is in and I am using MySql as database. I have some sample math papers in Microsoft office word. I want any kind of HTML input tool like textbox or editor so that I can copy office word formulas direct to editor and that I have to save into database


  1. Solve the inequation and represent the solution on the number line: (7x-5)/(2x+14) ≥ 1 1/4 (x ≥ -7), x ∈ R. [x ≥ 5]

Consider the above question if I do copy paste into textbox some of symbols it takes as garbage..


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

To save math equation into database, a text format is more applicable. You can convert it to any format.

Refer to this question understanding a mathematica equation on, there are many math formula with many specified chars and in text format.

There are many ways to render a text formula.

  1. <script type="math/tex" id="MathJax-Element-19">n(r) = frac{2pi r^2}{sqrt{3}}</script>, the math equation is with text format n(r) = frac{2pi r^2}{sqrt{3}} in latex format.
  2. <math xmlns=""><mi>n</mi><mo stretchy="false">(</mo><mi>r</mi><mo stretchy="false">)</mo><mo>=</mo><mfrac><mrow><mn>2</mn><mi>π</mi><msup><mi>r</mi><mn>2</mn></msup></mrow><msqrt><mn>3</mn></msqrt></mfrac></math> is in mathml format.
  3. You also can use a render in your server or a client render to render the text formual to a image, like <img src=" = frac{2pi r^2}{sqrt{3}}">

So you can choose a common formula format, when use it you can render it directly or convert it to other format, or image.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x