为什么php试图使用4GB绑定_结果
我犯了一个最奇怪的错误。首先,这是我非常简单的代码:为什么php试图使用4GB绑定_结果,php,mysql,mysqli,Php,Mysql,Mysqli,我犯了一个最奇怪的错误。首先,这是我非常简单的代码: <!DOCTYPE html> <html> <header> <link rel="stylesheet" type="text/css" href="/style.css" /> </header> <body> <?php require_once 'includes/con
<!DOCTYPE html>
<html>
<header>
<link rel="stylesheet" type="text/css" href="/style.css" />
</header>
<body>
<?php
require_once 'includes/config.php';
// Create connection
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_DATA);
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
//get safety sheat fields
$query="SELECT `fields` FROM `subforms` WHERE `id`=1 LIMIT 1";
$stmt = $conn->prepare($query);
$stmt->bind_result($fields);
$stmt->execute();
if (!$stmt->fetch()) {
echo 'error: no such form';
die();
}
die();
第20行$stmt->bind_result($fields)代码>
我真的不明白这是怎么可能的,也不知道从哪里寻找解决方法。有什么想法吗?通过添加
$stmt->store_result()代码>
在bind\u结果
行之前。仍然非常奇怪的是,它试图保留一条长文本可能存储的全部4GB容量。我想我确实需要增加ram或缩小字段,以防字段被填满。非常奇怪,顺便问一下,解释4GB的字段的数据类型是什么,下面的答案解决了这个问题,但最终导致数据在字段中存储的序列化数据中的a之后被截断。将字段更改为mediumtext修复了所有问题,我可能不需要超过16MB。
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4294967296 bytes) in /home/[path to files I don't wish to make public]/test.php on line 20