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