php - How to store value that consist of string and has a list into mysql database -


data example inserted mysql db:

value 1: "some text text text,  random number 123455,  unordered list:  <ul>    <li>some list</li>    <li>some list</li>    <li>some list</li>  </ul>";  value 2: "some text text,  there 2 unordered list here:  <ul>    <li>some list</li>    <li>some list</li>  </ul>  <ul>    <li>some list</li>    <li>some list</li>  </ul>  , more text , more text"; 

these example of value want insert mysql db, values have 1 or more list , texts while others may not contain list. since bad insert list html tag mysql db, , can't loop values , give them list tag since values not have list inside it, simplest , efficient solution this?

all suggestions welcomed. thx

you can encode data before inserting ... , when want read data must decode again... in db must make column data type text ... if using php there function encode , decode function ... or can use serialize , de-serialize


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -