Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

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

Aloittaja chinaren, lokakuu 29, 2019, 05:41:17 IP

« edellinen - seuraava »

chinaren

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
The Opus Path - The Next Generation of the Written Word

chinaren


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



The Opus Path - The Next Generation of the Written Word

chinaren

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
The Opus Path - The Next Generation of the Written Word

Kindred

ah....    so, the first thing to do would be to give the is_solved column a default value (typically NULL) in mySQL
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

chinaren

Right, thanks.  I'll do that, once I find the darned thing.
The Opus Path - The Next Generation of the Written Word

chinaren

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
The Opus Path - The Next Generation of the Written Word

Arantor

Holder of controversial views, all of which my own.


chinaren

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



The Opus Path - The Next Generation of the Written Word

Arantor

The column you are looking for is in the topics table in the database.
Holder of controversial views, all of which my own.


chinaren

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? 



The Opus Path - The Next Generation of the Written Word

Arantor

You need to go to xxx_topics (usually smf_topics) instead of xxx_boards and change it there.
Holder of controversial views, all of which my own.


chinaren

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.
The Opus Path - The Next Generation of the Written Word

Advertisement: