So I am not a very good coder but I needed some help, I am part of a network that allows it to postback information to my site. I want to track these things called lockers AKA 'aff_sub' So I already had some code that could get information from 1 locker but not multiple. I am wanting to track 5 more lockers, here is what I did
<?php
define("MYSQL_HOST", "localhost");
define("MYSQL_PORT", "3306");
define("MYSQL_DB", “db”);
define("MYSQL_TABLE", “tbl”);
define("MYSQL_USER", “user”);
define("MYSQL_PASS", “pass”);
$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;
}
$aff_sub = $_GET['affsub'];
$aff_sub2 = $_GET['affsub'];
$aff_sub3 = $_GET['affsub'];
$aff_sub4 = $_GET['affsub'];
$aff_sub5 = $_GET['affsub'];
$aff_sub6 = $_GET['affsub'];
$payout = $_GET['payout'];
if (!($stmt = $mysqli->prepare("UPDATE ".MYSQL_DB.".".MYSQL_TABLE." SET
payout=payout+(?) WHERE aff_sub=(?) ")))
{
echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
}
$stmt->bind_param('ds', $aff_sub, $aff_sub2, $aff_sub3, $aff_sub4, $aff_sub5, $aff_sub6, $payout);
if (!$stmt->execute())
{
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
}
else
{
printf("%d Row updated, added $".$payout." to locker ".$aff_sub." .
", mysqli_stmt_affected_rows($stmt));
}
?>
Thats what i tried out to get track the lockers, but it doesnt work it just says 'Execute failed: (2031) No data supplied for parameters in prepared statement' I dont know what to do please help.