PHP / MySQL致命内存分配错误
发布时间:2020-05-25 08:53:01 所属栏目:PHP 来源:互联网
导读:我得到了致命错误:此行上允许的内存大小为268435456字节(尝试分配4294967296字节)错误: $stmt - bind_result($title, $author, $contents, $date, $image, $status); 一个mysqli / php语句,查询是一个select语句,从数据库中获取1行文本,有谁知道什么是错误
|
我得到了致命错误:此行上允许的内存大小为268435456字节(尝试分配4294967296字节)错误: $stmt -> bind_result($title,$author,$contents,$date,$image,$status); 一个mysqli / php语句,查询是一个select语句,从数据库中获取1行文本,有谁知道什么是错误的? 此页面上的完整(且唯一)功能: function get_selected_article($post_type,$post_id,$post_name)
{
$con = new mysqli("---my ip---","---my user---","---my pass---","---my database---");
if (mysqli_connect_errno())
{
echo "A problem has occurred";
exit();
}
if ($stmt = $con -> prepare("SELECT `title`,`author`,`content`,`date`,`image`,`status` FROM ---my table--- WHERE `id` = ? AND `type` = ? ORDER BY `id` DESC"))
{
$stmt -> bind_param("is",$post_type); // "i" for int
$stmt -> execute();
$stmt -> bind_result($title,$status);
while ($stmt -> fetch())
{
echo "<table class = 'single_article_table'>";
echo "<tr><td align='left'>".$date."</td><td align='left'>".$post_type."</td><td align='right'>".$author."</td></tr>";
echo "<tr><td colspan='2'>".$title."</a></td></tr>";
echo "<tr><td colspan='3'>".$content."</td></tr>";
echo "</table>";
}
$stmt -> close();
}
$con -> close();
}
谢谢 您的内容列是LONGTEXT – “一个TEXT列,最大长度为4,294,967,295或4GB(232-1)字符.”来自文档: http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html(编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
