PHP binding 'bigint' datatype (MySQLi prepared statement)
问题 $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(); } My problem lies with the studentId variable. Its value is too long to be stored as a standard integer so it must be stored as a bigint. When binding the parameter as an integer it simply enters '1' as the studentId value.