3
我最近不得不修改下面的SQL這樣:奇怪的SQL錯誤IIS 7
$this->db->select('StaffMembers.Id AS StaffMembers_Id, Contacts.AssociatedStaffMember_Id');
$this->db->join("StaffMembers", "Contacts.AssociatedStaffMember_Id=StaffMembers.Id");
$q1 = $this->db->get_where($this->contacts_table, 'Contacts.AssociatedStaffMember_Id ='.$ContactId);
$s = $q1->row_array();
然而,當我登錄時,它會顯示一箇舊的SQL:
A Database Error Occurred
Error Number:
Invalid column name 'Contact_Id'.
SELECT Contacts.Id, StaffMembers.Id AS StaffMember_Id
FROM StaffMembers JOIN Contacts ON Contacts.Id=StaffMembers.Contact_Id
WHERE Contacts.Id =161
我已經重新啓動MSSQL服務器,刷新memcached和iis7,但它仍然顯示舊的查詢。不知道,爲什麼地球上這麼做,有什麼想法?
發現的問題,似乎是在控制器類中的一些重複的SQL(當有不應該的!)
修正了 - 問題就解決了。乾杯。
您是否在CodeIgniter中使用某種查詢緩存機制? [CI數據庫緩存(http://codeigniter.com/user_guide/database/caching.html) – Quantastical
都能跟得上不是,我知道了,有沒有檢查的快捷方式? – thejoker
查找範圍爲線設置'$分貝[ '缺省'] [ 'cache_on']'的值配置文件(application /配置/ database.php中)。如果您不僅僅使用默認值,請務必檢查您的應用程序的配置文件。 – Quantastical