推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
omg21
V2EX  ›  Python

用 base64 编码过的字符带 b',如何存入数据库?

  •  
  •   omg21 · Jul 9, 2016 · 4754 views
    This topic created in 3771 days ago, the information mentioned may be changed or developed.
    我在把带有单引号和双引号还有其他特殊字符的网页代码存入数据库时用了 base64 转换,但是转换后的字符串带了个 b'...',现在还是没法代换到 SQL 的 values('%s')里,应该怎么解决?
    5 replies  •  2016-07-10 18:49:25 +08:00
    imn1
    imn1
    Jul 9, 2016
    1
    decode
    billlee
    billlee
    Jul 9, 2016
    2
    decode('ascii')
    notgod
    notgod
    Jul 10, 2016 via iPhone
    3
    搜索 php mysql 转义
    非 php 也一样 都有转义函数

    自动加 /

    专门应对这种情况 你不看文档的吗?
    beginor
    beginor
    Jul 10, 2016 via Android
    4
    插入式不能做参数化么?
    iyangyuan
    iyangyuan
    Jul 10, 2016 via iPhone
    5
    这,是个 orm 框架都会做转义吧?不要自己拼 sql
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1398 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 22:05 · PVG 06:05 · LAX 14:05 · JFK 17:05
    ♥ Do have faith in what you're doing.