2

我使用这个查询

$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&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Yenimahalle,+Gersan,+Ankara,+T%C3%BCrkiye&amp;aq=0&amp;oq=gersan+&amp;sll=39.982382,32.760887&amp;sspn=0.157578,0.308647&amp;ie=UTF8&amp;hq=&amp;hnear=Bat%C4%B1+Sitesi+Mh.,+Gersan,+Ankara%2FYenimahalle,+Turkey&amp;t=m&amp;ll=39.955543,32.696342&amp;spn=0.029607,0.060854&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=Yenimahalle,+Gersan,+Ankara,+T%C3%BCrkiye&amp;aq=0&amp;oq=gersan+&amp;sll=39.982382,32.760887&amp;sspn=0.157578,0.308647&amp;ie=UTF8&amp;hq=&amp;hnear=Bat%C4%B1+Sitesi+Mh.,+Gersan,+Ankara%2FYenimahalle,+Turkey&amp;t=m&amp;ll=39.955543,32.696342&amp;spn=0.029607,0.060854&amp;z=14&amp;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

可能是什么问题?我被卡住了,因为我什么都看不到。

4

1 回答 1

0

Try using the urlencode function when putting the data into the table and then using the urldecode function when pulling it out. This will get rid of all the ampersands.

$sq="UPDATE contact SET ".$pType."='". urlencode($content) ."'";

于 2012-10-31T18:34:11.843 回答