I’m saving contents of a particular div in mysql database as html elements.
So the html elements content includes many elements such as:
<div id="div0" class="box" style="z-index: 2; width: 1689px; height: 1013px;">
<img style="margin: 0px; position: relative; display: block; height: 550px; width: 638px; top: 0px; left: 0px;">
</div>
Is there any way to reduce the data for efficiently storing in mysql database.
Such as any php or javascript functions to compress before saving to db.
You could compress the string before saving it to the database using
gzcompress()/gzuncompress()PHP functions or you can do it with mysql usingCOMPRESS()/UNCOMPRESS()in your queries – but unless you have very much data I would not recommend this.You win some harddisk space, but you lose a lot of transparency (search, edit, convert, migrate…)