I have the following code:
mysqli_stmt_bind_param accepts variables (by reference). You cannot use literals. Change your code to
$fileSize = 123;
$stmt->bind_param('ssi', $string1, $string2, $fileSize);
Please try the variable assignment after bind_param(). It is a passed by reference call. So it will work after also.
$stmt = $db->prepare("INSERT INTO images (filename, mime_type, file_size) VALUES (?, ?, ?)");
$stmt->bind_param('ssi', $string1, $string2, $num);
$string1 = 'string 1';
$string2 = 'string 2';
$num=123;
$stmt->execute();