반응형
PHP 준비문 SQL with where 값
sql 테이블의 기존 행에서 이 쿼리를 실행하려고 합니다.
if($stmt = $mysqli->prepare("INSERT INTO 4rounds (player2_name, player2_army1_name, player2_army2_name, player2_army3_name, player2_army4_name, player2_identifier, player2_stage, player2_army1_position, player2_army2_position, player2_army3_position, player2_army4_position) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) WHERE pairing_id = ?")) {
그러나 다음 오류를 반환합니다.
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE pairing_id = ?' at line 1
쿼리는 WHERE 절 없이 작동합니다.이 문제에 있어서 파라미터 바인딩에 문제가 있다고 생각하고 추후에 VALUE를 사용해서 바인딩해야 하는데 온라인상에서 파라미터 바인딩에 대한 내용을 찾을 수가 없습니다.
제가 시도하고 있는 바인딩은 다음과 같습니다.
$stmt->bind_param("ssssssssssss", $player2_name, $player2_army1_name, $player2_army2_name, $player2_army3_name, $player2_army4_name, $player2_identifier, $player2_stage, $player2_army1_position, $player2_army2_position, $player2_army3_position, $player2_army4_position, $pairing_id);
INSERT문장이 없습니다.WHERE왜 그런 걸 원하시는지 모르겠네요그것들은 오직 에 존재합니다.SELECT그리고.UPDATE일반적으로 쿼리입니다.
언급URL : https://stackoverflow.com/questions/57937709/php-prepared-statement-sql-with-where-value
반응형
'programing' 카테고리의 다른 글
| 시작 작업의 스크립트 블록에 제기된 예외를 캡처하는 방법은? (0) | 2023.10.27 |
|---|---|
| Python의 추상 속성 (0) | 2023.10.27 |
| MySQL에서 grave accent(일명 백틱) 인용 문자의 의미는 무엇입니까? (0) | 2023.10.27 |
| jquery ajax json과 함께 양식 데이터 전송 (0) | 2023.10.27 |
| brew - mysql은 설치 계정에 서명하지 않으면 사용할 수 없습니다. (0) | 2023.10.27 |