missing ' ' from last two values!Code:mysql_query("INSERT INTO `donation` (`username`, `time`, `productid`, `price`, `tickets`) VALUES ('" . $user . "', '" . $date . "', '" . $prodid . "', '" . $amount . "', '" . $amountTickets . "');");
|
How can i fix the query, it's not writing the info in the database after i receive the payments, thanks.
This is the last part of the code where u make the query:
if($p->ipn_data["mc_gross"] > 0 && strcmp ($p->ipn_data["business"],$EMAIL) == 0) {
$user = $p->ipn_data["custom"];
$date = $p->ipn_data["payment_date"];
$prodid = $p->ipn_data["item_number"];
$amount = $p->ipn_data["mc_gross"];
$amountTickets = 1;
$user = str_replace("-", "_", $user);
$user = str_replace(" ", "_", $user);
$user = mysql_real_escape_string($user);
mysql_query("INSERT INTO donation (username, time, productid, price, tickets) VALUES ('" . $user . "', '" . $date . "', '" . $prodid . "', " . $amount . ", " . $amountTickets . ");");
// $fh = fopen(".ipnerr", "a");
// fwrite($fh, mysql_error());
// fclose($fh);
}
missing ' ' from last two values!Code:mysql_query("INSERT INTO `donation` (`username`, `time`, `productid`, `price`, `tickets`) VALUES ('" . $user . "', '" . $date . "', '" . $prodid . "', '" . $amount . "', '" . $amountTickets . "');");
huh, ohh thanks, hope it works now
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |