我一直在閱讀文檔和搜索google-net試圖找出如何構建mysql的select查詢,該查詢返回varchar字段中的雙引號。mysql選擇替換雙引號和#標籤
我發現的一切都表示不要在第一位插入引號而不會逃脫它們。同意100%...但我已經收到了其他人的數據庫。他們使用MySQL Workbench創建它...允許他們在varchar字段中輸入雙引號值。我怎麼得到雙重報價? mysql客戶端(命令行)和mysqli(php)都將雙引號轉換爲散列標籤。
我可以轉儲數據庫,通過它手動替換所有引號,然後重新導入。但是這隻有在我收到這個數據庫的下一個交付之前纔有效。
我在這裏錯過了什麼?
(我嘗試添加屏幕截圖,但Imagur似乎並不希望立即對它們進行處理)......所以這裏是我所看到的複製/粘貼:
在MySQL工作臺(只「價值」 字段):
If you would like to keep your responses anonymous, you may do so. Simply click on the 」anonymous」 checkbox above each 」Feedback」 block. When you submit your survey, you will be sent a link, by email, to revisit/modify your responses. Hold onto that email as that will be the only mechanism for associating you with your anonymous responses.
從MySQL客戶端:
mysql> select * from survey_labels where item_id=149;
+---------+------+-------+--------+------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| item_id | type | level | italic | bold | size | value |
+---------+------+-------+--------+------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 149 | text | 2 | 0 | 0 | NULL | If you would like to keep your responses anonymous, you may do so. Simply click on the #anonymous# checkbox above each #Feedback# block. When you submit your survey, you will be sent a link, by email, to revisit/modify your responses. Hold onto that email as that will be the only mechanism for associating you with your anonymous responses. |
+---------+------+-------+--------+------+------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.09 sec)
你弄明白了這個問題。編碼中存在不匹配。他們的表使用utf8_unicode_ui。我加載數據的表格是latin1_general_ui。我檢查了他們發送給我的表創建SQL,並且它對編碼保持沉默......所以我猜我有一些默認情況,假定是後者。 非常感謝! – MikeMayer67