- 两个表中的值列( $_SESSION['val1'] )都与索引(外键)连接
- 'process' 方法用于准备好的语句
- 我想在 mysql 中结合 $get 和 $get2
代码...
$get = $call->process("INSERT INTO table1 VALUES ( ?, ?, ?, ?, UTC_TIMESTAMP(), 0)
ON DUPLICATE KEY
UPDATE col4 = ?, col5 = UTC_TIMESTAMP()",
array($_SESSION['val1+val2'], $_SESSION['val1'], $_SESSION['val2'], 'OK', 'NOOK'));
if($get)
{
$get2 = $call->process("UPDATE table2 SET col8 = col8 + 1 WHERE colval1 = ?",
array($_SESSION['val1']));
}
我应该创建存储过程吗?