Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 162010

How to format MySQL output as HTML


If you want MySQL to return query result as HTML format, you can use the -H option

# mysql -H -e 'select now()' -u root 

<TABLE BORDER=1><TR><TH>now()</TH></TR><TR><TD>2010-01-16 20:30:45 </TD></TR></TABLE>

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>