php - Postback URL Code For Locker -


let me explain story, starting website users can join , track stuff website, want create postback link inserts 'payout' table locker code, when try , test it, gives me error

execute failed: (2031) no data supplied parameters in prepared statement 

so here code used...

<?php  define("mysql_host", "localhost"); define("mysql_port", "3306"); define("mysql_db", "dbuser"); define("mysql_table", "userpayout"); define("mysql_user", "user"); define("mysql_pass", "dbpassweord");  $mysqli = new mysqli(mysql_host, mysql_user, mysql_pass, mysql_db); if ($mysqli->connect_errno)  {   echo "failed connect mysql: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } $aff_sub1    =         $_get['aff_sub']; $aff_sub2   =         $_get['aff_sub']; $aff_sub3   =         $_get['aff_sub']; $aff_sub4   =         $_get['aff_sub']; $aff_sub5   =         $_get['aff_sub']; $aff_sub6   =         $_get['aff_sub']; $payout     =         $_get['payout'];   if (!($stmt = $mysqli->prepare("update ".mysql_db.".".mysql_table." set  payout=payout+(?) aff_sub1=(?)")))  {   echo "prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;  } $stmt->bind_param('ds', $aff_sub1, $aff_sub2, $aff_sub3, $aff_sub4, $aff_sub5, $aff_sub5, $payout); if (!$stmt->execute())  {   echo "execute failed: (" . $stmt->errno . ") " . $stmt->error; } else {   printf("%d row updated, added $".$payout." locker ".$aff_sub1." .\n",  mysqli_stmt_affected_rows($stmt)); }  ?> 

so trying track multiple aff_subs lockers payout from. want insert row same affsubs.

check variables $aff_sub1, $aff_sub2, payout etc. before calling bind_param make sure set.

also make sure postback link invoked via method, since retrieving variables $_get.


Comments