programing

포스트백 실행 실패: (2031) 준비된 문의 매개 변수에 대한 데이터가 제공되지 않았습니다.

randomtip 2022. 12. 11. 10:26
반응형

포스트백 실행 실패: (2031) 준비된 문의 매개 변수에 대한 데이터가 제공되지 않았습니다.

이건 내 포스트백이야표시할 때마다 php 코드

실행 실패: (2031) 준비된 문에서 매개 변수에 대한 데이터가 제공되지 않았습니다.

내가 어디서 실수를 하고 있는지 모르겠어, 제발 도와주세요. 이미 다 찾아봤지만 해결책을 찾지 못했어요.

define("MYSQL_HOST", "localhost");
define("MYSQL_PORT", "xxxx");
define("MYSQL_DB", "u530xxxx312_tap");
define("MYSQL_TABLE", "taxxx");
define("MYSQL_USER", "u5xxxx312_naxxxb");
define("MYSQL_PASS", "Mcxxxx455");

// Connecting to database, using MySqli
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASS, MYSQL_DB);
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}

// Setup postback variables
$uid            = $_POST['uid'];
$tid            = $_POST['tid'];
$cpid           = $_POST['cpid'];
$api_token      = $_POST['api_token'];
$payout_amount  = $_POST['payout_amount'];
$revenue        = $_POST['revenue'];

// Insert log into database
if (!($stmt = $mysqli->prepare("INSERT INTO ".MYSQL_DB.".".MYSQL_TABLE." (uid, tid, cpid, api_token, payout_amount, revenue) VALUES (?, ?, ?, ?, ?, ?)"))) {
  echo "Preparation failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
$stmt->bind_param('sssssss', $uid, $tid, $cpid, $api_token, $payout_amount, $revenue);

if (!$stmt->execute()) {
  echo "Execution failed: (" . $stmt->errno . ") " . $stmt->error;
} else {
  printf("Added new conversion with uid: ".$uid." .\n");
}

언급URL : https://stackoverflow.com/questions/51330820/postback-execution-failed-2031-no-data-supplied-for-parameters-in-prepared-st

반응형