我使用此查询
$sq="UPDATE `contact` SET `".$pType."`='".$content."'";
它工作正常但直到我将此代码输入文本区域:
<iframe width="710" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Yenimahalle,+Gersan,+Ankara,+T%C3%BCrkiye&aq=0&oq=gersan+&sll=39.982382,32.760887&sspn=0.157578,0.308647&ie=UTF8&hq=&hnear=Bat%C4%B1+Sitesi+Mh.,+Gersan,+Ankara%2FYenimahalle,+Turkey&t=m&ll=39.955543,32.696342&spn=0.029607,0.060854&z=14&iwloc=A&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=Yenimahalle,+Gersan,+Ankara,+T%C3%BCrkiye&aq=0&oq=gersan+&sll=39.982382,32.760887&sspn=0.157578,0.308647&ie=UTF8&hq=&hnear=Bat%C4%B1+Sitesi+Mh.,+Gersan,+Ankara%2FYenimahalle,+Turkey&t=m&ll=39.955543,32.696342&spn=0.029607,0.060854&z=14&iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small>
它更新但缺少信息;
像这样:<iframe width="710" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q
可能出现什么问题?我被卡住了,因为我看不到任何东西。
答案 0 :(得分:0)
在将数据放入表格时使用urlencode函数,然后在拉出时使用urldecode函数。这将摆脱所有的&符号。
$ sq =“UPDATE contact SET”。$ pType。“='”。 urlencode($ content)。“'”;