<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>潘锦的空间 &#187; php_mysql</title>
	<atom:link href="https://www.phppan.com/tag/php_mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.phppan.com</link>
	<description>SaaS SaaS架构 团队管理 技术管理 技术架构 PHP 内核 扩展 项目管理</description>
	<lastBuildDate>Sat, 04 Apr 2026 01:19:58 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>mysql数据表之间数据相互传递的问题</title>
		<link>https://www.phppan.com/2009/11/mysql-data-bet-table/</link>
		<comments>https://www.phppan.com/2009/11/mysql-data-bet-table/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 09:15:47 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php_mysql]]></category>
		<category><![CDATA[PHP应用]]></category>

		<guid isPermaLink="false">http://www.phppan.com/?p=381</guid>
		<description><![CDATA[mysql数据表之间数据相互传递的问题 近日，某操作需要从一个表（表A）读取一些数据，然后直接写入另外一个表（ [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>mysql数据表之间数据相互传递的问题</p>
<p>近日，某操作需要从一个表（表A）读取一些数据，然后直接写入另外一个表（表B）（相当于一个备份）<br />
平时没啥问题，某天测试MM将一些乱七八糟的数据写入后就出问题了，这些数据从页面提交到表A时没有问题，<br />
但是从表A读取后写入表B确实有问题，将错误的SQL输出，发现其中包含单引号等一些在SQL中特殊的字符，<br />
此时，需要将这些数据过滤，简单处理：使用addslashes函数，</p>
<p>string addslashes ( string str )</p>
<p>返回字符串，该字符串为了数据库查询语句等的需要在某些字符前加上了反斜线。这些字符是单引号（&#8217;）、双引号（&#8221;）、反斜线（\）与 NUL（NULL 字符）。 </p>
<p>在官方手册中也有提到使用这个函数作为数据写入数据库的一个示例</p>
<p>结论：写入数据表之前需要将所有的数据过滤，以防SQL注入或其它特殊字符的写入错误！</p>
<p>另外，addslashes对于防止SQL注入有一些用处，但是对于引号，可以用0xbf27来代替单引号，而addslashes只是将0xbf27修改为0xbf5c27，成为一个有效的多字节字符，其中的0xbf5c仍会被看作是单引号，所以addslashes此时无法防止SQL注入。此函数的用于单字节字符串的处理会比较有用。然而多字节字符还是用mysql_real_escape_string好些。</p>
]]></content:encoded>
			<wfw:commentRss>https://www.phppan.com/2009/11/mysql-data-bet-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows下PHP环境配置的问题</title>
		<link>https://www.phppan.com/2009/08/windows-apache-php-setting/</link>
		<comments>https://www.phppan.com/2009/08/windows-apache-php-setting/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 15:18:00 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[程序相关]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php_curl]]></category>
		<category><![CDATA[php_mysql]]></category>
		<category><![CDATA[php环境配置]]></category>
		<category><![CDATA[短符号]]></category>

		<guid isPermaLink="false">http://www.phppan.com/?p=135</guid>
		<description><![CDATA[         自从Windows7发布测试版后，一直作为小白鼠在用着，界面和用户体验都不错，但是一段时间后 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>         自从Windows7发布测试版后，一直作为小白鼠在用着，界面和用户体验都不错，但是一段时间后发现使用Xampp搭建的PHP环境运行起来暴慢，今天终于不能再忍受了，于是把Xampp给卸载了，使用手工安装的环境，但是“涛声依旧”。Google了一上，说是32位机与64位的问题，貌似系统是32的w7，奇怪了！</p>
<p>        最后不得已，重新安装了XP，手动安装PHP环境，但是在安装的过程中出现了如下几个问题：</p>
<p>        1、  关于短符号，即是否允许使用&lt;? ?&gt;，在现在使用的模块类中，生成的代码是以短符号包含PHP代码的，导致无法加载文件。</p>
<p>        2、  关于扩展地址，即extension_dir，默认情况下是&#8221;./&#8221;，这个是必须要改的。</p>
<p>        3、  php_mysql.dll扩展，在扩展地址和apache配置安装完成后，可以运行PHP了，但是发现在apache的错误日志显示<strong>PHP Warning:  PHP Startup: Unable to load dynamic library &#8216;D:/work/php/ext/php_mysql.dll</strong>，在phpinfo()显示的扩展中并没有mysql，google下发现是某些扩展需要一些在system32中添加动态链接库，mysql和mysqli在PHP &gt;= 5.0.0 需要 <strong>libmysql.dll</strong>，</p>
<p>        4、  与3类似，显示<strong>PHP Warning:  PHP Startup: Unable to load dynamic library &#8216;D:/work/php/ext/php_curl.dll&#8217;</strong> 。curl函数库需要<strong>libeay32.dll</strong><strong>，ssleay32.dll</strong>，解决方法：把php目录下的这两个文件拷贝到system32下即可。其它详细信息请移步<a href="http://php.chinaunix.net/manual/zh/install.windows.extensions.php">Windows 下安装扩展库</a></p>
]]></content:encoded>
			<wfw:commentRss>https://www.phppan.com/2009/08/windows-apache-php-setting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
