首页 > 代码库 > MYSQL转换JSON
MYSQL转换JSON
http://51strive.com/
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>在线 Mysql 转换 json串</title>
</head>
<body>
<H1><div style="text-align:center;">在线 Mysql 转换 json串</div></H1>
<h2><font color="red">2016.5.16 修复xmpphp-0.1rc2-r77支持php7</font></h2>
<a href="https://github.com/onefishum/xmpphp-for-php7" target="_blank">xmpphp-0.1rc2-r77 for php7</a><P>
Mysql 输出格式:<br>
mysql> select * from demo_test;<br>
<pre>
+-----+--------------+------+------+------+
| c1 | c2 | c3 | c4 | c5 |
+-----+--------------+------+------+------+
| a11 | 123456789 | 10 | 1 | 0 |
| AA | HELLO, HELLO | 8 | 0 | 0 |
+-----+--------------+------+------+------+
</pre>
<P>
<H2><font color="red">注:拷贝表格部分</font><br></h2>
<div style="courier new">
<form name=‘msyql2json‘ action="" method="post" accept-charset="utf-8">
<input type="submit" name="submit" value="http://www.mamicode.com/提交" onclick="checkValid()" >
<P>
<textarea id="strData" name=‘text‘ style="width:800px;height:320px;">
</textarea><br>
</div>
</form>
<p>
Json串:<p>
null<div style="display:none"> <a href="http://www.art-zys.com"></a></div>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "http://hm.baidu.com/hm.js?e8bbc4c2aa86f142f8c62acd306e2497";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script language="javascript">
function checkValid()
{
var tex = document.getElementById("strData");
if(tex.value.length > 16384)
{
alert("输入不超过16384个字符!已经超出"+Number(tex.value.length-16384));
return false;
}
return true;
}
</script>
</body>
</html>
MYSQL转换JSON