MyBB Community Forums

Full Version: 1366 - Incorrect integer value: '' for column 'tid' at row 1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Image: 08Jf6Zf.png]

it showed that error when i tried to activate Show the users that has been online today (2.0)

SQL Error:
1366 - Incorrect integer value: '' for column 'tid' at row 1
Query:
INSERT INTO mybb_templates (`tid`,`title`,`template`,`sid`) VALUES ('','online_today_index','<tr> <td class="tcat"><strong>{$lang->whos_online_today}</strong> [<a href="online.php?action=today">{$lang->complete_list}</a>]</td> </tr> <tr> <td class="trow1"><span class="smalltext">{$lang->online_note_today}<br />{$onlinemembers}</span></td> </tr>','-1')
I had the same exact issue when interacting with a plugin few weeks ago on a new MyBB installation.
I'm not 100% sure I remember how I fixed it but, if I recall correctly, I replaced the empty space inside the tid SQL VALUES part with '0'.

This has been done by:
1. Uninstalling the specific plugin I was using from ACP -> Plugins
2. Browsing inc/pluginname.php  (where pluginname was the plugin php file) with my File Manager Code Editor
3. Editing the INSERT INTO statement in this way

from this
Quote:INSERT INTO mybb_templates (tid,title,template,sid) VALUES ('','online_today_index','<tr> <td class="tcat"><strong>{$lang->whos_online_today}</strong> [<a href="online.php?action=today">{$lang->complete_list}</a>]</td> </tr> <tr> <td class="trow1"><span class="smalltext">{$lang->online_note_today}<br />{$onlinemembers}</span></td> </tr>','-1')

to this
Quote:INSERT INTO mybb_templates (tid,title,template,sid) VALUES ('0','online_today_index','<tr> <td class="tcat"><strong>{$lang->whos_online_today}</strong> [<a href="online.php?action=today">{$lang->complete_list}</a>]</td> </tr> <tr> <td class="trow1"><span class="smalltext">{$lang->online_note_today}<br />{$onlinemembers}</span></td> </tr>','-1')

4. Installing the plugin again



Note: you may find something like this inside plugin file:
Quote:function pluginname_activate()
{
global $db, $lang, $cache;

$template = array(
"tid" => "NULL",
"title" => "pluginname",

....

In this case you may replace
Quote:"tid" => "NULL",

with
Quote:"tid" => "0",


Again, I'm not 100% sure this is what I did, but it was something very close and it fixed the issue in my case.
You can just remove the line with “tid” completely, the value doesn’t need to be defined at all as it’s automatically generated by the database.
(2022-01-02, 01:51 AM)ShadowOne Wrote: [ -> ]I had the same exact issue when interacting with a plugin few weeks ago on a new MyBB installation.
I'm not 100% sure I remember how I fixed it but, if I recall correctly, I replaced the empty space inside the tid SQL VALUES part with '0'.

This has been done by:
1. Uninstalling the specific plugin I was using from ACP -> Plugins
2. Browsing inc/pluginname.php  (where pluginname was the plugin php file) with my File Manager Code Editor
3. Editing the INSERT INTO statement in this way

from this
Quote:INSERT INTO mybb_templates (tid,title,template,sid) VALUES ('','online_today_index','<tr> <td class="tcat"><strong>{$lang->whos_online_today}</strong> [<a href="online.php?action=today">{$lang->complete_list}</a>]</td> </tr> <tr> <td class="trow1"><span class="smalltext">{$lang->online_note_today}<br />{$onlinemembers}</span></td> </tr>','-1')

to this
Quote:INSERT INTO mybb_templates (tid,title,template,sid) VALUES ('0','online_today_index','<tr> <td class="tcat"><strong>{$lang->whos_online_today}</strong> [<a href="online.php?action=today">{$lang->complete_list}</a>]</td> </tr> <tr> <td class="trow1"><span class="smalltext">{$lang->online_note_today}<br />{$onlinemembers}</span></td> </tr>','-1')

4. Installing the plugin again



Note: you may find something like this inside plugin file:
Quote:function pluginname_activate()
{
global $db, $lang, $cache;

$template = array(
"tid" => "NULL",
"title" => "pluginname",

....

In this case you may replace
Quote:"tid" => "NULL",

with
Quote:"tid" => "0",


Again, I'm not 100% sure this is what I did, but it was something very close and it fixed the issue in my case.

didin't work, after changing the tid i went to the acp to activate the plugin it showed me the error 500

(2022-01-02, 01:58 AM)Matt Wrote: [ -> ]You can just remove the line with “tid” completely, the value doesn’t need to be defined at all as it’s automatically generated by the database.

i have commented it it showed error 500
You’d need to ask your host or check your error log to find out what caused a 500.