PHP绑定'bigint'数据类型(MySQLi准备语句)

jsk*_*dd3 4 php mysql sql mysqli

$studentId = 57004542323382
$companyOfferId = 7

$sql = 'INSERT INTO studentPlacement (companyOfferId, studentId) VALUES (?, ?)';

if ($stmt = $db->prepare($sql)) {
    $stmt->bind_param("ii", $offerId, $studentId);
    $stmt->execute();
    $insertId = $stmt->insert_id;
    $stmt->close();
}
Run Code Online (Sandbox Code Playgroud)

我的问题在于studentId变量.它的值太长而无法存储为标准整数,因此必须将其存储为bigint.将参数绑定为整数时,只需输入"1"作为studentId值.据我所知bind_param支持4种类型; 整数,字符串,blob和double.有没有人对如何解决这个问题有任何想法,所以我可以正确地发送值作为bigint?

谢谢

sec*_*tus 8

使用$studentId = '57004542323382'; // quotes added和字符串参数进行绑定.