How to resolve 'cannot pass parameter by reference' error in PHP?
Posted
by
kush.impetus
on Stack Overflow
See other posts from Stack Overflow
or by kush.impetus
Published on 2011-11-27T17:43:58Z
Indexed on
2011/11/27
17:50 UTC
Read the original article
Hit count: 449
Here's my code:
UploadTime) VALUES (?,?,?,?)');
$stmt->bind_param('isss', $caseno, $index.'.'.$extension, date('Y-m-d H:i:s'), date('Y-m-d H:i:s'));
I have tried this also:
$stmt = $conn->mysqli->prepare('INSERT INTO photos (CaseNo, ImageName, CaptureTime, UploadTime) VALUES (?,?,?,?)');
$captureTime = date('Y-m-d H:i:s');
$uploadTime = date('Y-m-d H:i:s');
$stmt->bind_param('isss', $caseno, $index.'.'.$extension, $captureTime, $uploadTime);
I am getting the error:
Fatal error:** Cannot pass parameter 3 by reference in **...file path...line #
Please note that CaptureTime and UploadeTime have datatype date. And ignore the fact that I am passing the value of 3rd and 4th parameter same.
What's wrong with the code?
© Stack Overflow or respective owner