lists = []
lists = cursor.execute(
"select a.employee_id,a.first_name,"
"c.breakfast_count, b.lunch_count,"
"d.dinner_count from qpscsmas_employee_details a,"
"qpscsmas_emp_lunch b,"
"qpscsmas_emp_breakfast c,"
"qpscsmas_emp_dinner d "
"where a.rfidcardno = %s "
"and b.rfidcardno = %s "
"and c.rfidcardno = %s "
"and d.rfidcardno = %s,"
"['s','s','s','s']"
)
print lists
上面的查询给了我一个空的列表。Django原始查询
问题在于它也没有显示任何错误。
它是在MySQL工作正常,当我在地方的参数
正是你的问题是什么??? – 2014-11-04 05:26:35
我的问题是,我无法传递参数,更具体地说,我需要在querey中使用参数的方式。 我附加了工作正常的querey。 cursor.execute(从qpscsmas_employee_details a选择a.employee_id,a.first_name,c.breakfast_count,b.lunch_count,d.dinner_count,qpscsmas_emp_lunch b,qpscsmas_emp_breakfast c,qpscsmas_emp_dinner d其中a.rfidcardno ='7b5c7f45'和b.rfidcardno = '7b5c7f45'和c.rfidcardno ='7b5c7f45'和d.rfidcardno ='7b5c7f45') – 2014-11-04 06:48:56