|
$a="aaa'a";
$b="bbb'b";
$c="ccc'c";
$d="ddd'd";
这句能执行但是看不懂,
$sql="insert into `ci_guestbook` (`id`,`username`,`email`,`content`,`reply`,`dateline`)values('',".'"'.$a.'",'
.'"'.$b.'",'.
'"'.$c.'",'.
'"'.$d.'",now())';
这一句能看到,但执行不了,
$sql="insert into `ci_guestbook` (`id`,`username`,`email`,`content`,`reply`,`dateline`)values('','" & replace($a,"'","''") & "','" & replace($b,"'","''") & "','" & replace($c,"'","''") & "','" & replace($d,"'","''") & "',now())";
大家有没有更好的办法?谢谢! |
|