News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Database Error

Started by fox0r, August 04, 2009, 10:46:39 PM

Previous topic - Next topic

fox0r

Now it tells me:

Database Error
Please try again. If you come back to this error screen, report the error to an administrator.
Back

And I still cannot log in.

fox0r

I tried:


<?php
include('SSI.php');

global 
$smf_;
$request $smcFunc['db_query'](''"ALTER TABLE {smf_}members
ADD passwd_flood varchar(12) NOT NULL default ' ';"
,__FILE____LINE__);

?>



And it gave me:
An Error Has Occurred!
Hacking attempt...
Back

I had to laugh a little.

Arantor

That was the wrong code to use. I didn't want you to change the db_prefix entry since 2.0 will do that itself quite happily without you changing anything.

The reason for the hacking attempt is because there is a ; in query.

Please try this exact code without any alterations:

<?php
include('SSI.php');

$request $smcFunc['db_query'](''"ALTER TABLE {db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default ' ' "
,__FILE____LINE__);

?>


fox0r

Alright.  Done.  No errors from the addcolumn.php this time, but I'm still getting the same error when I try to log in.

I had the other admin on the board paste me the most recent error from the log --

http://www.bqinternet.com/~jpohlman/htss/index.php?action=login2


Database Error: Unknown column 'passwd_flood' in 'field list'


File: /usr/home2/jpohlman/public_html/htss/Sources/LogInOut.php
Line: 226

Arantor

Agh, I really should not just edit 1.1 queries.


<?php
include('SSI.php');

$request $smcFunc['db_query'](''"ALTER TABLE {db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default ' ' "
);

?>


Though if you got no errors it may have already done it, not sure.

fox0r

Quote from: Arantor on August 05, 2009, 09:14:22 PM
Agh, I really should not just edit 1.1 queries.


<?php
include('SSI.php');

$request $smcFunc['db_query'](''"ALTER TABLE {db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default ' ' "
);

?>


Though if you got no errors it may have already done it, not sure.

That worked.  Thanks so much!  <3

Arantor

Excellent! Should I mark the topic solved now?

fox0r

Now the two mods I have installed aren't working lol.

I swear if it isn't one thing, it's another.

I figured I would just uninstall and reinstall them.. but when I click on uninstall it gives me a bunch of parse errors. :(

fox0r

Nothing in the logs.. I don't know what I would of done that made the mods stop working.  They worked before I logged out and couldn't log back in again, so I really have no clue.

Arantor

Have you installed any other mods since then? Changed theme?

Normally it's best to uninstall in the reverse order of installing - last first.

fox0r

Nope.  I didn't change anything at all other than what I was told to do here.  Everything worked great before I logged out.  I only have the two mods installed, and both give me parse errors when I go to uninstall them.

Arantor

Well, the code between 2.0b3 and 2.0RC1.2 is quite different, unfortunately.

Which mods were they? You may be able to do the removal manually.

fox0r

These were installed fresh when I installed the forum, which is why it doesn't make sense why it magically stopped working.

I did a fresh forum install, then installed the mods, then logged out to check one of them, and couldn't get back in, basically.

They are:
Hide Tag 2.3.5
Dice Roller BBcode 1.0

I had logged out to check the hide tag, to make sure it was functioning.

babjusi

Quote from: Arantor on August 05, 2009, 07:50:39 PM
db_query doesn't work because this is a 2.0 forum.

Instead try:

<?php
include('SSI.php');

$request $smcFunc['db_query'](''"ALTER TABLE {db_prefix}members
ADD passwd_flood varchar(12) NOT NULL default ' '"
);

?>



Ah, but of course. I pressumed it was a 1.1. serie. Thanks for correcting it Arantor :)

Arantor

Well, I don't know about the hide tag, but I can tell you that the Dice Roller should be compatible with both 2.0b3 and 2.0RC1.2 even though when I added the mod I couldn't select 2.0b3.

Dice Roller doesn't do any DB edits at all, it's all in the source.

fox0r

It's really weird that it just... stopped working.  The only other thing I changed was turning off attachments, which I've since turned back on.

Neither of these mods were installed on 2.03b, just 2.1RC1.2.

It also makes no sense why updating the DB would suddenly give me a ton of parse errors for uninstall.  I'm going to rename the packages and upload them again to see if it does on install -- They both installed just fine with the installer and no errors before.

fox0r

Oh, I just remembered, I ran the auto-fix errors thing in the admit panel.  Maybe that broke it.

fox0r

I just checked the Subs.php file to see if the code was still in it, and it is not.

So I went ahead and reinstalled the mod, and nadda, it didn't even edit the file.  It all tested okay, though, but it made no modifications to the subs.php file.

The file and directory are both CMHOD to 777.

Arantor

Autofix again shouldn't break Dice Roller; Dice Roller makes NO database edits anywhere in SMF.

If it didn't edit the file that suggests there is a problem. So what do you get on the main Browse Packages screen, does it say it's installed?

fox0r

I got it to work.  My packages/temp directory decided to disappear.  It seems that it is disappearing after every mod install now, so I have to go back into my FTP and recreate it.  Not a big deal, but a PITA none the less.

Advertisement: