Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Aiheen aloitti: chinaren - lokakuu 29, 2019, 05:41:17 IP

Otsikko: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 29, 2019, 05:41:17 IP
Hi there.  It's been a long time since I did anything techy, but I'm trying to set up a new board, well, did so, and installing a few mods, as you do. 
All seemed to be going well, and I'd posted a few test posts, and then added a couple more mods, then when I tried posting a new thread (preview and replying to the few threads already there work) I get the error:

The database value you're trying to insert does not exist: id_board

It seems to be coming from the subs-post line 1854, according to my error log:



The database value you're trying to insert does not exist: id_board
/home/xxx/public_html/Sources/Subs-Post.php
Line: 1854

Line: 1854


The code in this area looks, to me, okay, but there's probably a comma wrong or something...


// Insert a new topic (if the topicID was left empty.)
if smcFunc['db_insert']('',
'{db_prefix}topics',
array(
'id_board' => 'int', 'id_member_started' => 'int', 'id_member_updated' => 'int', 'id_first_msg' => 'int',
'id_last_msg' => 'int', 'locked' => 'int', 'is_sticky' => 'int', 'num_views' => 'int',
'id_poll' => 'int', 'unapproved_posts' => 'int', 'approved' => 'int', 'add_authors' => 'string',
'id_prefix' => 'int', 'add_authors' => 'string',
),
array(
$topicOptions['board'], $posterOptions['id'], $posterOptions['id'], $msgOptions['id'],
$msgOptions['id'], $topicOptions['lock_mode'] === null ? 0 : $topicOptions['lock_mode'], $topicOptions['sticky_mode'] === null ? 0 : $topicOptions['sticky_mode'], 0,
$topicOptions['poll'] === null ? 0 : $topicOptions['poll'], $msgOptions['approved'] ? 0 : 1, $msgOptions['approved'], !empty($topicOptions['add_authors']) ? $topicOptions['add_authors'] : '',
$topicOptions['id_prefix'] == null ? 0 : $topicOptions['id_prefix'], !empty($topicOptions['add_authors']) ? $topicOptions['add_authors'] : '',
),
array('id_topic')      <----Here.
);
$topicOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}topics', 'id_topic');($new_topic)
{
$





Mods installed/not are:



1.BBC Message Boxes2.0.1
2.BotBanish Firewall Client3.4.00
3.Top First Post2.0.6
4.SMF Gallery Lite6.0d
5.Additional Polls1.2.2
6.Additional Topic Authors0.1.1
7.SMF Post Prefix2.1.1
8.SMFShop4.0.1
9.Off-Topic_BBC_Tag1.1.2
10.AJAX Recent Topics1.1
11.VigLink1.0.1
12.Add These Sites in Profile, Post & Memberlist1.5
13.TinyPortal1.6.4
14.Topic Solved1.1.1
15.Bookmarks2.5



Is this a simple fix?  Any ideas?  Thank you for your help!




[edit] some formatting removed -Illori
[edit2] additional clean up to make it readable
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 05:02:39 AP

Lainaa[edit] some formatting removed -Illori
[edit2] additional clean up to make it readable
Thanks guys, was going to tidy the post up more, but had to dash off somewhere.

Just found another error that happened at the same time as the above, not sure if it throws any more light on the issue:

array_combine(): Both parameters should have an equal number of elements
/home/xxx/public_html/Sources/Subs-Db-mysql.php
Line: 1472



Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 05:13:46 AP
Okay, update:

I've been uninstalling all my mods and trying a new post after each install, and after uninstalling the 'topic solved' mod, the error changed to:

Field 'is_solved' doesn't have a default value
File: /home/xxx/public_html/Sources/Subs-Post.php
Line: 1851



However, this line is the same line as in the code posted above
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: Kindred - lokakuu 30, 2019, 09:21:57 AP
ah....    so, the first thing to do would be to give the is_solved column a default value (typically NULL) in mySQL
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 10:10:47 AP
Right, thanks.  I'll do that, once I find the darned thing.
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 10:33:12 AP
Er, any idea where I would look for this?  I found a field called topic_solved and assigned a default value to NULL, but doesn't seem to have done the trick.  Twas under the _boards table/field/whatever


:P
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: Arantor - lokakuu 30, 2019, 12:35:42 IP
There will be one under the topics table too.
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 03:43:44 IP
Okay, I don't get this.  I uninstalled the mod, but the error...


field 'is_solved' doesn't have a default value


...still comes up if I try to post a new topic.  Shouldn't this have been removed from the DB when I uninstalled the mod?  I can't find the field is_solved in my DB either, only a 'topic_solved' file, which I changed to default of NULL. 


:o



Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: Arantor - lokakuu 30, 2019, 03:50:13 IP
The column you are looking for is in the topics table in the database.
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 05:08:29 IP
Lainaus käyttäjältä: Arantor - lokakuu 30, 2019, 03:50:13 IP
The column you are looking for is in the topics table in the database.


Could you tell me where the topics table is?  I've never been great at SQL, but I've always somehow managed.  There's a table called


xxx_boards 


(I assume this is the table) under which are many fields, including id_topic and topic_solved both of which I have set to NULL, I hope.


I also found another somewhere, underl logs_boards I think, which I set to NULL.


What am I doing wrong? 



Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: Arantor - lokakuu 30, 2019, 05:13:53 IP
You need to go to xxx_topics (usually smf_topics) instead of xxx_boards and change it there.
Otsikko: Re: The database value you're trying to insert does not exist: id_board
Kirjoitti: chinaren - lokakuu 30, 2019, 05:22:23 IP
Aha!  Found it!  Thank you!  I was looking in the wrong place in the SQL thingy*. 


Found is_solved field and set it to null.  I'm getting another error now [size=78%]Wrong value type sent to the database. Integer expected. (current_board) [/size][/size][size=78%]but progress is being made! [/size] ;D


I'm like a man blundering around in a dark room, looking for the exit.  I'll bump into many things on the way, but I'll find it in the end haha.


Thanks again! 






*This is a technical term.