1
데이터를 수정할 수 있도록 PDO 준비 매개 변수 배열을 foreach 문에 전달하고 있습니다. 접두사에 따라 일부 데이터가 수정됩니다.PHP Foreach and unsetting variables
foreach($param as $key => $t)
{
if(strpos($key,"int")===0)
{
$t = (int) $param[$key];
$key = str_replace("int","",$key);
unset($param[$key]);
$param[$key] = $t;
}
}
내가 접두사로 INT와 그 배열 요소를 설정 해제하고, 내가 때문에 PDO 오류로 쿼리를 실행할 수 없습니다 방법을 잘 모르겠어요 :
Invalid parameter number: number of bound variables does not match number of tokens
실제로 전에 이것을 시도했지만 그 다음에는 $ key에 poINTs가 있습니다. :) – kingW3