如何在mysqli中存储和检索xml字符串

时间:2017-01-27 15:00:55

标签: php mysql xml mysqli

我有一个很长的字符串。

<?xml version="1.0" encoding="utf-8"?>
<GamePlaySession xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <selectedFederation>-1</selectedFederation>
   <selectedComissioner>-1</selectedComissioner>
   <myCash>0</myCash>
   <myTokens>0</myTokens>
   <myLevel>0</myLevel>
   <shownBlurbCount>0</shownBlurbCount>
   <isNewPlayer>true</isNewPlayer>
   <inTutorialMode>true</inTutorialMode>
   <flavorTutorialClear>false</flavorTutorialClear>
   <calendarTutorialClear>false</calendarTutorialClear>
   <resultTutorialClear>false</resultTutorialClear>
   <storePurchaseTutorialClear>false</storePurchaseTutorialClear>
   <storeRefreshTutorialClear>false</storeRefreshTutorialClear>
   <storeTutorialClear>false</storeTutorialClear>
   <transitionMessageClear>false</transitionMessageClear>
   <storeCardsBought>0</storeCardsBought>
   <storePurchases>
       <boolean>false</boolean>
       <boolean>false</boolean>
       <boolean>false</boolean>
   </storePurchases>
   <newGamePlus>false</newGamePlus>
   <currentYear>0</currentYear>
   <currentMonth>0</currentMonth>
   <numberOfYears>10</numberOfYears>
   <worldChampCardNumber>0</worldChampCardNumber>
   <titleChampCardNumber>0</titleChampCardNumber>
   <tagChampCardNumbers>
       <int>0</int>
       <int>0</int>
   </tagChampCardNumbers>
   <worldChampLastCardNumber>0</worldChampLastCardNumber>
   <titleChampLastCardNumber>0</titleChampLastCardNumber>
   <tagChampLastCardNumbers>
       <int>-1</int>
       <int>-1</int>
   </tagChampLastCardNumbers>
   <firstShopCards>false</firstShopCards>

我想将它存储在列中。我使用的是urlencode以及mysql_real_escape_string(),但它不起作用。 Any1知道如何存储它?

0 个答案:

没有答案