MySQL table export to HTML -


i've got little problem exporting mysql data html. problem in 1 field have values this: <a href="http://google.com">google</a> , when export table in html format generated html table fields contains: &lt;a href=&quot;http://google.com&quot;&gt;google&lt;/a&gt; not valid html link. there way export table without mysql convert < , > chars?

im not using code. use mysql command:mysql -h "select ...." , specify output file.

thanks!

when export table in html format generated html table fields contains: &lt;a href=&quot;http://google.com&quot;&gt;google&lt;/a&gt; 

that's weird, don't behaviour (in 5.1.34):

$ mysql -h -e "select 'a&b<c>d'"; <table border=1><tr><th>a&b<c>d</th></tr><tr><td>a&b<c>d</td></tr></table> 

and want behaviour quote escaping! can see example, run risk of malformed html otherwise. eg. </table> in value break entire output.

if want control output format allow raw-html content in or columns, (a) will need write code this, , (b) have sure content in database known-safe html, free of malformed strings might break table, or malicious javascript.

the -h option mysql insufficient task, , seems quite unreliable judging our different results! you'll want pick scripting language mysql bindings , output rows manually.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -