Skip to main content
var names
Source Link
samplebias
  • 38k
  • 6
  • 110
  • 104

It differs by driver. Here are two examples:

import MySQLdb dmc = MySQLdb.connect() r = dmc.cursor() r.execute('select %s, %s', ("foo", 2)) r._executed "select 'foo', 2" import psycopg2 connpc = psycopg2.connect() r = connpc.cursor() r.execute('select %s, %s', ('foo', 2)) r.query "select E'foo', 2" 

It differs by driver. Here are two examples:

import MySQLdb d = MySQLdb.connect() r = d.cursor() r.execute('select %s, %s', ("foo", 2)) r._executed "select 'foo', 2" import psycopg2 conn = psycopg2.connect() r = conn.cursor() r.execute('select %s, %s', ('foo', 2)) r.query "select E'foo', 2" 

It differs by driver. Here are two examples:

import MySQLdb mc = MySQLdb.connect() r = mc.cursor() r.execute('select %s, %s', ("foo", 2)) r._executed "select 'foo', 2" import psycopg2 pc = psycopg2.connect() r = pc.cursor() r.execute('select %s, %s', ('foo', 2)) r.query "select E'foo', 2" 
Source Link
samplebias
  • 38k
  • 6
  • 110
  • 104

It differs by driver. Here are two examples:

import MySQLdb d = MySQLdb.connect() r = d.cursor() r.execute('select %s, %s', ("foo", 2)) r._executed "select 'foo', 2" import psycopg2 conn = psycopg2.connect() r = conn.cursor() r.execute('select %s, %s', ('foo', 2)) r.query "select E'foo', 2"