php - oscommerce tep_db_perform -- 更新

标签 php mysql insert-update oscommerce

我正在研究更新数据库中值的简单函数, 我很奇怪,当我添加超过 1 个 where 子句时,查询不起作用。

我已经为此工作了 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 的新手,所以请帮助我。 谢谢....

最佳答案

试试下面的代码。

您的 $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 . "'");

关于php - oscommerce tep_db_perform -- 更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29797175/

相关文章:

php - 将文本文件中的数据插入mysql

MySQL 与 MS SQL Server — 执行插入/更新的并行进程

sql - 从插入结果更新表

sql - 从另一个表更新一个表

php - $_POST 未知数量的元素

javascript - jQuery ajax 模式在加载时提交表单

MySql:如果在函数内部或外部调用,相同的 select count(*) 查询将返回不同的结果

mysql - GROUP_CONCAT 字符串问题

php - 使用 jQuery 将多维数组转为表格

php - 从数据库中阻止 .htaccess 或 PHP 中的 IP 地址?