PDA

View Full Version : getting database error, when i setup new forum


sourabh
09-21-2006, 04:07 AM
hello,

when i signup on my website...i get a database error,

Database Error

We're sorry, we seem to be experiencing problems with our database. Please try refreshing this page to see if this message goes away.
The database server might be restarting. If this message still appears, please try again later. You may also contact the site owner if you wish.

it was working fine, till yesterday...when i installed cash mod, now today i installed shopmod, n after that its not working...its not because of new_forum_sql because when i upload the previous non edited file...i get the same error..

Please help...m new to this script so i dont know much...

Thanks

Cronos
09-21-2006, 04:35 AM
in the cash mod you have to do some query? :)
if you missed this query to add it in the new_foum_sql.php this can't work

Derek
09-21-2006, 06:18 AM
Did you mess up something in nbs/new_forum_sql.php? Maybe one of the queries has a bad syntax or errors in it. If you want me to take a look, please post the nbs/new_forum_sql.php file.

Derek

sourabh
09-21-2006, 10:32 AM
its not the matter with new_forum_sql....i done it correctly....

i replaced that file with the original file, with no modification....still i get the error....its due to something else....

still, if you want, i'm attaching the edited file....

thanks for your replies....

yeah, and one more thing....when i checked in phpmyadmin, all the tables r there....with the name i signed up....but i cant access that forum....so please help

Cronos
09-21-2006, 02:40 PM
if you have edited some forum file wich need an sql edit you SHOULD add it into the file
and you SHOULD do this edit for ALL the forum already up

Derek
09-21-2006, 05:54 PM
Wait, so you were getting the database error before you installed the mod as well?

sourabh
09-22-2006, 03:20 AM
after installing the cash mod...it was fine....but when i installed the shop mod.....it all went wrong..

its maybe bcos of shop mod.....can u please help me out of this matter.

derek i can give you ftp access, if you can help me....thanks..

sourabh
09-22-2006, 12:39 PM
anyone gonna help....plzzzzzzz

BMR777
09-22-2006, 05:39 PM
Can you access new forums that are created? If it's just that you can't access old forums it's most likely because the exisiting forums don't have the sql that was in new_forum_sql.php because it wasn't there when they were installed. You will need to maunally query the exisiting forums in phpmyadmin.

BMR777

sourabh
09-23-2006, 04:43 AM
i can access the old forums, but not the new forums....

www.forumgiveaway.com

Derek
09-23-2006, 10:38 AM
Whats the url to a forum that's not working?

sourabh
09-24-2006, 04:43 AM
yeah thats right...
www.forumgiveaway.com/new_forum.php

sourabh
09-24-2006, 06:10 AM
ok guys, thanks....i deleted all the deleted and edited files and loaded them again....now i can register new forum..

but for the modifications i installed, it doesn't create table in the sql...most probably, there is some problem in this new forum sql file....maybe i have edited wrongly....
so m attaching my new forum sql file and the readme file of the mod.....i'm not attaching readme of cash mod, bcos it was working fine before this...

it will be great, if you will help... :)

Cronos
09-24-2006, 07:25 AM
this is a HUGE mod
you have to edit ALL the file wich access to DB for let it point to every new table name

if your mod try to access to something like

'phpBB_shop'
you haven't it

you have
'forumname_shop'

so you retrive a DB error
are you undestand what i've said?

you have to edit all the SQL command into you mod file to let it work with a different table for every forum

sourabh
09-24-2006, 07:54 AM
yeah, i get everything you said...i was thinking about that, but....its just a different case....

the new forum sql file, gives a command to create tables, rite?
but when i check the phpmyadmin, that tables are missing like....forumname_shop

previously, i installed cash mod, which is also a big mod i think, but it was working fine...

Cronos
09-24-2006, 08:16 AM
O_o?


in the 'accessname'_config
the value are put into?

the config file seems to be correct

Derek
09-24-2006, 08:20 AM
yeah, i get everything you said...i was thinking about that, but....its just a different case....

the new forum sql file, gives a command to create tables, rite?
but when i check the phpmyadmin, that tables are missing like....forumname_shop

previously, i installed cash mod, which is also a big mod i think, but it was working fine...
When you checked to see if the tables existed, were you looking at a new forum's tables or an old one that was there before you edited new_forum_sql.php?

Derek
09-24-2006, 08:21 AM
Hmm, I might have found the problem...


$sql[] = "ALTER TABLE " . $accessname . "_users ADD " . $accessname . "user_trade TEXT;";

Should be:

$sql[] = "ALTER TABLE " . $accessname . "_users ADD user_trade TEXT;";

sourabh
09-24-2006, 11:20 AM
ok guys i got the problem....but dont know how to solve that...

these lines have the problem...if i put these lines, i get an database error, n if i delete these...it works fine, but i think, these r imp queries...so please tell wats wrong in them...

original ones..
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('multibuys', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('restocks', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sellrate', '55')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewtopic', 'images')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewprofile', 'images')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewinventory', 'grouped')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewtopiclimit', '5')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_orderby', 'name')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_give', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_trade', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_discard', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_invlimit', '0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_owners', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_districts', 'off')";

i replaced . CONFIG_TABLE . with $accessname

and i also tried replacing " . CONFIG_TABLE . " with " . $accessname . "_config also

but its of no use.... so please tell me wats wrong in them....

i think cronos got this before me, but i dint get wat he said....

Derek
09-24-2006, 11:34 AM
Can you post the full file with all the changes you just made so I can take a look again?

sourabh
09-24-2006, 01:10 PM
i havent done any change, just by hit and trial method, i find the problem....
still i'm attaching the file, and the original sql file, which i got with the mod..

Derek
09-24-2006, 01:54 PM
I don't see this code in new_forum_sql.php...


$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('multibuys', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('restocks', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sellrate', '55')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewtopic', 'images')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewprofile', 'images')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewinventory', 'grouped')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('viewtopiclimit', '5')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_orderby', 'name')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_give', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_trade', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_discard', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_invlimit', '0')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_owners', 'on')";
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('shop_districts', 'off')";


Of course you will have to modify that though like the rest of the multi-forums code so it gets executed properly...

sourabh
09-24-2006, 02:09 PM
yeah, i have modified it....pasted there and when i try i get db error....but when i remove this, i dont get any error, means this has got some error....i modified it just like the previous files, by replacing the config table with $accessname and all....

sourabh
09-25-2006, 01:58 AM
please tell me, is these modifications rite....

i done the same modifications with cash mod which is working fine, but with shop mod, i get error....y?

Cronos
09-25-2006, 02:20 AM
i'm not well in english, but.. you explain your problem very bad..

when you edit the new_forum_sql.php you CREATE NEW FORUM and test it?
or you do the test with a forum PREVIUS created? ( in this case.. i haven't word for you :P )

sourabh
09-25-2006, 03:54 AM
when i edit the new_forum_sql.php i CREATE NEW FORUM and test it

Cronos
09-25-2006, 04:01 AM
ok,now

in the new forum, you have the table?
if not, edit the new_forum.php near the include of new_forum_sql.php
when it does the query


foreach ($sql AS $query)
{
$db->query($query);
}


put some debugging info like


foreach ($sql AS $query)
{
echo '<br> Next query: '.$query;
$db->query($query);

}

and check if the query are well formed
later check if the DB present ALL the table, and ALL the value the script has to add

sourabh
09-25-2006, 04:46 AM
i get the same database error, after adding the foreach ($sql AS $query)
{
echo '<br> Next query: '.$query;
$db->query($query);

}

in the new_forum.php

and tell me is these lines correct or not.
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('multibuys', 'on')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('restocks', 'on')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('sellrate', '55')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('viewtopic', 'images')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('viewprofile', 'images')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('viewinventory', 'grouped')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('viewtopiclimit', '5')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_orderby', 'name')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_give', 'on')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_trade', 'on')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_discard', 'on')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_invlimit', '0')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_owners', 'on')";
$sql[] = "INSERT INTO " . $accessname . "_config (config_name, config_value) VALUES ('shop_districts', 'off')";

sourabh
09-25-2006, 06:16 AM
i solved the problem....there was an extran underscore " _ " in the create table it was . $accessname . "shop instead of ."_shop

lol

still the mod is not working but that error is not there now....i'll check it out myself or i'll 4gt abt this mod....

Thanks for your help Cronos and derek

Cronos
09-25-2006, 06:45 AM
what i've said to do, is a debug function :)
so you can see

test__shop ( 2 underscore :) )
so you can fix it ;)

sourabh
09-25-2006, 01:38 PM
dint get wat u said....

when i added that debug function, script gone mad....it was just because of that underscore...are you sayin to put 2 underscores there....

ok, will try it..

thanks

Cronos
09-25-2006, 02:52 PM
no
i'm sayng that

if you add the debug function that i've told you, you can see the EXACT query will be executed, so you can investigate WHY the script doesn't create the right table

( you have told us that the script doesen't create the tabled you need )

Derek
09-25-2006, 04:17 PM
i solved the problem....there was an extran underscore " _ " in the create table it was . $accessname . "shop instead of ."_shop

lol

still the mod is not working but that error is not there now....i'll check it out myself or i'll 4gt abt this mod....

Thanks for your help Cronos and derek
You say you solved the problem, but it's still not working... are you getting database errors still or no?

sourabh
10-22-2006, 12:04 PM
yeah, i was busy from some days n dint work on my website...now i dropped the plan for adding shop...now without adding shop sql querries it work fine...

thanks for your help guys...

Derek
10-22-2006, 10:11 PM
No Problem.