Database error - and no idea how to go about resolving this

Started by pepf, December 28, 2024, 06:02:28 AM

Previous topic - Next topic

pepf

dB things are something I don't dare messing with. Can anyone suggest how to resolve this, please? There is the following error message:
--------
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'offset
FROM smf_log_spider_stats
WHERE stat_date < '2024-10-01'' at line 1


SELECT COUNT(*) AS offset
FROM smf_log_spider_stats
WHERE stat_date < '2024-10-01
------


Thanks in advance
Peter

Bugo

Open ManageSearchEngines.php, find
SELECT COUNT(*) AS offsetand replace with
SELECT COUNT(*)

Kindred

Сл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."

Arantor

Holder of controversial views, all of which my own.


pepf

2.1.5?
Is that coming out any time soon?

SMF 2.14  /   10.6.20-MariaDB-cll-lve

I'm afraid I can't find a file with the name ManageSearchEngines.php

Thanks.

Arantor

Quote from: pepf on December 29, 2024, 01:17:50 AM2.1.5?
Is that coming out any time soon?

SMF 2.14  /   10.6.20-MariaDB-cll-lve

I'm afraid I can't find a file with the name ManageSearchEngines.php

Thanks.

No idea, but this is the sort of thing that should be fixed in it.

ManageSearchEngines.php is in the Sources folder.
Holder of controversial views, all of which my own.


vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

Offset is a reserved word. Maria is doing the correct thing here, incidentally, by making it a reserved word after all.

LIMIT x, y is actually a shorthand MySQL introduced forever ago and that its popularity led other things (notably Postgres) to adopt it but it's not actually universal at all - and it's really a short form for LIMIT y OFFSET x.

(ANSI 92 SQL didn't cover this; MS SQL and Oracle don't even do LIMIT x, y in any fashion, you have to simulate it by way of using ROWNUM() to get the current row number and bodge it in the where clause. SQL:2008 did standardise this, but the official standard is something completely different.)
Holder of controversial views, all of which my own.


vbgamer45

Ah I see reserved word makes a lot more since since. I was worried for some reason that the AS statement was not allowed.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

pepf


pepf

The OFFSET code change did not help. In the meantime I have found other links and function that are admin section internal that also do end in a domain not found message. The funny thing is that everything on the user side seems to be operating normally.

Tried to run repair_settings, but it also does not work. Everything in the test forum works normally. So, perhaps there is something broken in the files.

Question: is there a way to replace specific files that may involved without breaking the whole setup? Is moving the whole forum to another folder the best solution?

Thanks for any help.
Peter

Kindred

You can always re-upload a fresh set of files from the upgrade archive (not the install archive, because that would erase your Settings.php
Сл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."

pepf

Thanks for answering.
May ask what the Settings.php exactly does? Is it a global settings file or only for certain purposes within the whole? And, would any topics or dBs become unusable?

TIA, Peter

Aleksi "Lex" Kilpinen

#13
Settings.php holds necessary settings for SMF to talk to your database, without it nothing works.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF


pepf

Thank you all for the information. I will try this and see if it resolves the problem.

Peter

Doug Heffernan

Quote from: pepf on January 20, 2025, 11:49:39 PMAnd, would any topics or dBs become unusable?

WHat do you mean by dBs? Did you mean the database? The answer to that is No. The topics, posts, members and all the other important file is stored in the database and not in the files. Overwriting the forum files, if done properly, will not affact the database. However if you have made manual changes to the  files, or you have mods that edit the files directly then all those changes they will be undone. So you might want to make a backup first of the files that have manual edits in them.

Advertisement: