Log in

View Full Version : VERY IMPORTANT! I need to know how to add this one table back, I have a gernal idea


Xelation
04-17-2003, 05:46 AM
ok, I added a hack that required me to drop this table... the hack doesnt work and now when I delete thread theirs and error.. So I reverted all the php files back and now I need to add the threadrate table back to mysql... I took at look at the install file in the admin dir.... I found this..



$explain[]="Creating table thread";

$query[]="CREATE TABLE threadrate (
threadrateid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
threadid int(10) unsigned DEFAULT '0' NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
vote smallint(6) DEFAULT '0' NOT NULL,
ipaddress varchar(20) NOT NULL,
PRIMARY KEY (threadrateid),
KEY threadid (threadid)
)";
$explain[]="Creating table thread rate";


I was wondering.. what would I need to do to add that to mysql, I know how to run queires, but would I just run this?


$query[]="CREATE TABLE threadrate (
threadrateid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
threadid int(10) unsigned DEFAULT '0' NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
vote smallint(6) DEFAULT '0' NOT NULL,
ipaddress varchar(20) NOT NULL,
PRIMARY KEY (threadrateid),
KEY threadid (threadid)
)";


another qurey it told me to run was this...

UPDATE forum SET allowratings='0' WHERE allowratings = '1'

how can I reverse that?


I appreciate any help I can get! :)

Erwin
04-17-2003, 06:16 AM
According to what you've posted, you can run these queries:


CREATE TABLE threadrate (
threadrateid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
threadid int(10) unsigned DEFAULT '0' NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
vote smallint(6) DEFAULT '0' NOT NULL,
ipaddress varchar(20) NOT NULL,
PRIMARY KEY (threadrateid),
KEY threadid (threadid));


and then this:


UPDATE forum SET allowratings='1';


to return back to where you were...

Xelation
04-17-2003, 06:18 AM
THANKS SO MUCH ERWIN!!!! it worked :D That made my day!... I wish people didnt release hacks that dont work

Tigga
04-17-2003, 06:22 AM
The query you should run to add the table would be:

CREATE TABLE threadrate (
threadrateid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
threadid int(10) unsigned DEFAULT '0' NOT NULL,
userid int(10) unsigned DEFAULT '0' NOT NULL,
vote smallint(6) DEFAULT '0' NOT NULL,
ipaddress varchar(20) NOT NULL,
PRIMARY KEY (threadrateid),
KEY threadid (threadid));

To reverse the other query you would run this one:

UPDATE forum SET allowratings='1' WHERE allowratings = '0';

That will update all your forums to allow ratings. Alternatly you could just change the option in the Admin CP.