2015-04-22 22 views
0

我正在更新數據庫中的值的簡單函數, 我很奇怪,當我添加多於1 where子句時,查詢沒有工作。oscommerce tep_db_perform - update

我已經工作了6個多小時了。 請幫助

第一查詢工作:

tep_db_perform(TABLE_CUSTOMERS_EDUCATIONS, $sql_data_array, 'update', "customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'"); 

該查詢不起作用:

tep_db_perform(TABLE_CUSTOMERS_EDUCATIONS, $sql_data_array, 'update', "customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'" . " and seq_no = '" . (int)$education_seq . "'"); 

似乎有沒有對這個愚蠢的問題了很多討論,但偏偏我對着這個。 我知道這可能是一個簡單的問題,但我是非常新的PHP,所以請幫助我。 謝謝....

回答

3

請嘗試以下代碼。

您的$sql_data_array應該是正確的。

$sql_data_array = array('customers_id' => (int)$HTTP_GET_VARS['cID'], 
         'seq_no' => (int)$education_seq 
         ); 

tep_db_perform(TABLE_CUSTOMERS_EDUCATIONS, $sql_data_array, 'update', "customers_id = '" . (int)$HTTP_GET_VARS['cID'] ."' and seq_no = '" . (int)$education_seq . "'"); 
+0

如果我的答案正在爲你工作,那麼標記它是正確的,以幫助其他人面臨同樣的問題。樂意效勞。 – Jayson

+0

它的工作原理,謝謝。 – user3423149