• ADADADADAD

    SQL注入在哪里传递参数值[ 网络知识 ]

    网络知识 时间:2024-12-03 15:09:59

    作者:文/会员上传

    简介:

    SQL注入在%s占位符的字典传参,示例代码:import pymysqldb = pymysql.connect(host="119.XX.XX.XX",port=3306,user="XXXXXXXX",passwd="XXXXXXXXXXXXX",db="XXXXXX",charset='

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    SQL注入在%s占位符的字典传参,示例代码:

    import pymysql

    db = pymysql.connect(host="119.XX.XX.XX",

    port=3306,

    user="XXXXXXXX",

    passwd="XXXXXXXXXXXXX",

    db="XXXXXX",

    charset='utf8')

    # %s 占位符为需要传递的参数,切记不要加''双引号,要不然会报错

    sql = "SELECT totalusercount * 1.4 FROM mm_project_uv_outdoor WHERE poiid = %s AND currenttime = %s"

    cursor = db.cursor()

    # 以下为传递多个参数的用法

    cursor.execute(sql,['B00140N5CS','2019-04-23'])

    # 传递单个参数时 cursor.execute(sql,'B00140N5CS')

    print(cursor.fetchall())

    db.close()

    SQL注入在哪里传递参数值.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: sql注入传递参数