Wednesday 1 November 2017

mysqli - PHP Fatal error: Call to a member function bind_param() on a non-object

I have the following
code:



$statement =
$mysqli->prepare("INSERT INTO `paypal_transactions` (`txn_id`, `payer_email`,
`mc_gross`, `mc_currency`, `expires`, `userid`) VALUES (?, ?, ?, ?, " . (time() +
2678400) . ", ?)");

file_put_contents('error.txt',
$mysqli->error . mysqli_error($mysqli));
$statement->bind_param('ssdsi',
$txn_id, $payer_email, $payment_amount, $payment_currency,
$userid);
$statement->execute();


error.txt
is blank every single time, and this is what I see in the error_log
file:



[02-Jul-2013 09:08:15
America/Denver] PHP Fatal error:
Call to a member function bind_param() on a
non-object in /home4/site/public_html/paypal.php on line
96



which is
referring to the block of code above.



I am at my
wits end with this, I have been trying to fix it for hours and it just won't work. I
cannot find any problems with my sql query and I am losing my mind trying to figure out
what's wrong.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...