python使用变量操作mysql语句

python操作mysql和其他语言一样,都是很简单的,只需要导入MySQLdb模块,然后再连接就可以操作了。n在这里说说怎么样在里面使用变量值来查询,例如:n……nusername = “liang”nresult=cur.execute(“select password from user where nickname = username)n…….n上面的是错误的,原来错误的以