21,887
社区成员
发帖
与我相关
我的任务
分享
function db_cv($array){
if(is_array($array)){
foreach($array as $key=>$value){
$array[$key]=str_replace(array("\\","'"),array("\\\\","\'"),$value);
}
}
return $array;
}
while($rt=db_cv($db->fetch_array($query))){
/*DDL Information For - test.a1*/
---------------------------------
Table Create Table
------ -----------------------------------------
a1 CREATE TABLE `a1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`str1` char(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
insert into a1(str1) values
('http://www.csdn.net'),
('c:\lamp.txt'),
('c:\\lamp.txt'),
('c:\\\\lamp.txt');
select * from a1;
query result(4 records)
id str1
1 http://www.csdn.net
2 c:lamp.txt
3 c:\lamp.txt
4 c:\\lamp.txt