Im getting the Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4294967296 bytes)
error on this line:
$stmt -> bind_result($title, $author, $contents, $date, $image, $status);
of a mysqli/php statement, the query is a select statement that gets 1 row of text from a database, does anyone know whats gone wrong?
Full (and only) function on this page:
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_id, $post_type); // "i" for int
$stmt -> execute();
$stmt -> bind_result($title, $author, $contents, $date, $image, $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();
}
Thanks
Your content
column is LONGTEXT - "A TEXT column with a maximum length of 4,294,967,295 or 4GB (232 – 1) characters." from the docs: http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With