MyBB Community Forums

Full Version: MyBB has experienced an internal SQL error and cannot continue when I add a long text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm trying to add a new page on my Mybb forum and I have tried various methods:

- In FTP added page "example.php" with only this code:

<?php
define("IN_MYBB", 1);
require_once "./global.php";
 
{
eval("\$output = \"".$templates->get("example")."\";");
output_page($output);
}
?>

- Page manager plugin

- Tried also to link html to php page (but this doesn't work, it's only a normal html page, it doesn't take variables from Mybb)

but if I add a long text (more than 300 rows more or less, in page content/template) I have "MyBB has experienced an internal SQL error and cannot continue" error.

Is there a limit to rows in template? for database?

Thank you in advance

Resolved!

Installed PHP in Templates plugin, created new page "example.html" with only html code.

In template "example" in Global templates:

<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
	
<style>
....
</style>
	
</head>
	
<body>
{$header}
<?php include('example.html'); ?>

{$footer}
</body>
</html>
(2023-06-20, 09:52 PM)niere8 Wrote: [ -> ]Is there a limit to rows in template? for database?

It´s limited by database table mybb_templates. The type of the field template can be TEXT, MEDIUMTEXT or LONGTEXT.
You can change it.
Assuming your host has phpMyAdmin for your account you can change this manually by going in and finding the templates table. Then clicking structure and the "change" button on "template". Here you can select the MEDIUMTEXT or LONGTEXT as stated by Schnapsnase.

I've attached images to help.

1. [attachment=46079]

2. [attachment=46080]