<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>木子的博客</title><link>https://www.muzi.ink/</link><description>Good Luck To You!</description><item><title>php odbc 链接 xls</title><link>https://www.muzi.ink/?id=8</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;$file=&amp;quot;D:/Users/meco/Desktop/tmp/t/x.xlsx&amp;quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;// 设置ODBC连接字符串&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;$dsn = &amp;quot;Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=$file&amp;quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;// 连接到XLSX文件&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;$conn = odbc_connect($dsn, &amp;#39;&amp;#39;, &amp;#39;&amp;#39;);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;// 检查连接是否成功&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;if (!$conn) {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; die(&amp;quot;连接失败: &amp;quot; . iconv( &amp;quot;GBK&amp;quot;,&amp;quot;UTF-8&amp;quot;,&amp;nbsp; odbc_errormsg()));&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;// 执行查询&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;$sql = &amp;quot;SELECT * FROM [Sheet1$]&amp;quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;$result = odbc_exec($conn, $sql);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;// 读取数据&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;while ($row = odbc_fetch_array($result)) {&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp; print_r($row);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;// 关闭连接&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;odbc_close($conn);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 29 Mar 2024 17:42:32 +0800</pubDate></item><item><title>centos MySQL 5.7 数据存储位置迁移</title><link>https://www.muzi.ink/?id=7</link><description>&lt;p style=&quot;text-wrap: wrap;&quot;&gt;使用lnmp安装的mysql&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;1.首先做好备份,查看 /etc/my.cnf 找到 datadir ,显示为 /usr/local/mysql/var ;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;2.停止数据库 ,备份这个文件夹&amp;nbsp; cp&amp;nbsp;&amp;nbsp;/usr/local/mysql/var&amp;nbsp;&amp;nbsp;/usr/local/mysql/var_bak&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;3.移动文件夹到 新目录&amp;nbsp; &amp;nbsp;mv&amp;nbsp;/usr/local/mysql/var /home/mysql/var&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;4.修改&amp;nbsp;/etc/my.cnf 中所有&amp;nbsp;/usr/local/mysql/var 改成&amp;nbsp;/home/mysql/var&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;5.启动数据库,迁移完成&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 20 Feb 2024 14:49:03 +0800</pubDate></item><item><title>Connection reset by peer 的问题排查</title><link>https://www.muzi.ink/?id=6</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: wrap;&quot;&gt;Connection reset by peer,一般是安全软件拦截,考虑,服务器本机是否有安全软件(第三方独立安全软件是否存在),路由器中是否有安全软件,客户端是否有安全软件&lt;/span&gt;&lt;/p&gt;</description><pubDate>Tue, 20 Feb 2024 14:48:00 +0800</pubDate></item><item><title>微信支付宝自动提现设置</title><link>https://www.muzi.ink/?id=5</link><description>&lt;p&gt;自动提现&lt;/p&gt;&lt;p&gt;// 支付宝需要签约&lt;/p&gt;&lt;p&gt;https://app.alipay.com/solution/signWizard.htm?solutionAlias=deletationWithdraw&lt;/p&gt;&lt;p&gt;//微信&amp;nbsp; -- 产品中心 --&amp;gt; 我的产品 --&amp;gt; 自动提现&lt;/p&gt;&lt;p&gt;https://pay.weixin.qq.com/index.php/public/product/detail?pid=6&amp;amp;productType=0&lt;/p&gt;&lt;p&gt;&lt;br style=&quot;text-wrap: wrap;&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 20 Feb 2024 14:47:01 +0800</pubDate></item><item><title>JS 下划线命名转驼峰命名</title><link>https://www.muzi.ink/?id=4</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: wrap;&quot;&gt;&amp;nbsp;str.replace(/\_(\w)/g, (all,letter)=&amp;gt;letter.toUpperCase())&lt;/span&gt;&lt;/p&gt;</description><pubDate>Tue, 20 Feb 2024 14:46:13 +0800</pubDate></item><item><title>php 数组 中文按照拼音字头排序</title><link>https://www.muzi.ink/?id=3</link><description>&lt;p style=&quot;text-wrap: wrap;&quot;&gt;$array1=[&amp;quot;张&amp;quot;,&amp;quot;苗&amp;quot;,&amp;quot;女&amp;quot;,&amp;quot;云&amp;quot;];&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;uasort($array1, function($a, $b){return strcmp(iconv(&amp;#39;UTF-8&amp;#39;,&amp;#39;GBK&amp;#39;,$a),iconv(&amp;#39;UTF-8&amp;#39;,&amp;#39;GBK&amp;#39;,$b));});&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;foreach($array1 as $value){&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;&lt;/span&gt;echo $value;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;}&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 20 Feb 2024 14:44:20 +0800</pubDate></item></channel></rss>