Posts: 61
Threads: 21
Joined: Jun 2021
Reputation:
0
2022-01-01, 11:21 AM
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')
Tunisian.
Posts: 295
Threads: 99
Joined: Jul 2014
Reputation:
1
2022-01-02, 01:51 AM
(This post was last modified: 2022-01-02, 01:52 AM by ShadowOne. Edited 1 time in total.)
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.
Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2022-01-02, 01:58 AM
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.
Posts: 61
Threads: 21
Joined: Jun 2021
Reputation:
0
2022-01-02, 08:25 AM
(This post was last modified: 2022-01-02, 08:26 AM by xLoy.)
(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
Tunisian.
Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2022-01-02, 12:01 PM
You’d need to ask your host or check your error log to find out what caused a 500.
|