MySQL Forums
Forum List  »  PHP

mysqli_stmt_bind_parammysqli_stmt_bind_param not fully initializing error
Posted by: Michael Macgowan
Date: April 03, 2021 06:39PM

I am trying to update a table in my database with a single value in my variable, loadID. I am trying to locate the current user ID and put the value in the currentload column of the users table. I am using the stmt procedural coding. My bind statement looks correct but I get the error:

Uncaught Error: mysqli_stmt object is not fully initialized in C:\php\www\loads\includes\assign-inc.php:38 Stack trace: #0 C:\php\www\loads\includes\assign-inc.php(38): mysqli_stmt_bind_param(Object(mysqli_stmt), 'ii', 1000019, 29) #1 {main} thrown in C:\php\www\loads\includes\assign-inc.php on line 38

I get the same error if I replace "ii" with "ss".

My code is as follows:

$userID= $_SESSION['sessionID'];
$sql = "UPDATE users SET currentload = ? WHERE idusers=?";
$stmt = mysqli_stmt_init ($conn);
mysqli_stmt_bind_param ($stmt, "ii", $loadID, $userID);
mysqli_stmt_execute ($stmt);

The error indicates that the $loadID and $userID are correct. I have tried putting single quotes around the column names but I get the same error. The connection is good as I create the $loadID by an execute to the loads table in lines above the listed code.

Options: ReplyQuote

Written By
mysqli_stmt_bind_parammysqli_stmt_bind_param not fully initializing error
April 03, 2021 06:39PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.