News:

Wondering if this will always be free?  See why free is better.

Main Menu

smf_personal_messages DELETED

Started by alex30, February 11, 2010, 03:38:25 PM

Previous topic - Next topic

alex30

I just accidentally deleted this string from the database and now can't view my personal messages, it shows an error.

Could you tell me how to bring it back?

Thank in advance.

Arantor


alex30

#2
I didn't back it up before.   :-\ Is the another way of fixing this?

Paul_Pauline

All you can do is ask your host if they have a backup.
"In every life, no matter how full or empty one's purse, there is tragedy. It is the one promise life always fulfills.
Happiness is a gift and the trick is not to expect it, but to delight in it when it comes and to add to other people's store of it."
Pauline was one of those rare people who increased the store of happiness in the world.

alex30

There is an option under all tables - Create new table on database. It asks about name and number of fields. I know the name of the table but how many fields do I need to enter there and will it work?

Arantor

I can give you the information to rebuild the table, but it'll only have structure, no previous PMs will be stored.

alex30

Thanks Arantor, that would be great.

MrPhil

You said you "deleted a string". Do you mean that you deleted a table? If you don't have a backup, hopefully your host does. If not, you've lost your archive of PMs. You will need to re-create the table with the following structure:
CREATE TABLE smf_personal_messages (
  ID_PM int(10) unsigned NOT NULL auto_increment,
  ID_MEMBER_FROM mediumint(8) unsigned NOT NULL default '0',
  deletedBySender tinyint(3) unsigned NOT NULL default '0',
  fromName tinytext NOT NULL,
  msgtime int(10) unsigned NOT NULL default '0',
  subject tinytext NOT NULL,
  body text NOT NULL,
  PRIMARY KEY (ID_PM),
  KEY ID_MEMBER (ID_MEMBER_FROM, deletedBySender),
  KEY msgtime (msgtime)
) TYPE=MyISAM;

and EMPTY the smf_pm_recipients table, since it refers to PMs which no longer exist. I'm not sure what other PM information is kept in the database -- there might be error messages popping up here and there referring to PMs which no longer exist.

You'll now have empty PM tables, ready for use.

On the other hand, if it wasn't a table that you deleted (check in phpMyAdmin and try to browse the table), what is it that you deleted?

Arantor

CREATE TABLE IF NOT EXISTS `smf_personal_messages` (
  `ID_PM` int(10) unsigned NOT NULL auto_increment,
  `ID_MEMBER_FROM` mediumint(8) unsigned NOT NULL default '0',
  `deletedBySender` tinyint(3) unsigned NOT NULL default '0',
  `fromName` tinytext NOT NULL,
  `msgtime` int(10) unsigned NOT NULL default '0',
  `subject` tinytext NOT NULL,
  `body` text NOT NULL,
  PRIMARY KEY  (`ID_PM`),
  KEY `ID_MEMBER` (`ID_MEMBER_FROM`,`deletedBySender`),
  KEY `msgtime` (`msgtime`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;


Note that you should empty the smf_pm_recipients table as well at this point.

EDIT: Ninja'd by MrPhil

alex30

Thanks Arantor, I deleted smf_personal_messages in Adminphp. You posted 2 code structures, which one should I use?

There is an option under all tables in adminphp where smf_personal_messages stayed - Create new table on database. It asks about name and number of fields. I know the name of the table but how many fields do I need to enter there?


Arantor

* Arantor looks up at the above... 7 columns. Then you have to tell it what kinds of columns they are - which is what the above statement will just do if you run it from the SQL tab.

Note - you may need to remove 'DEFAULT CHARSET=utf8' from yours if you're not running UTF-8 mode.

alex30

Thanks Arantor, you were very helpful.  :)

alex30

#12
The issue now is that I can't view smf_personal_messages in adminphp, but I can send messages on forum.


Arantor

What do you mean about viewing it in adminphp? There's no ability to view PMs in SMF...?

alex30

#14
You actually can and that's what I was doing to spot lots spammers.

Arantor look what our members keep getting on forum, message that has nothing in it. What did I do wrong?




Arantor

So, did you clear out the smf_pm_recipients table?

You will also need to clear out two columns in the smf_members table (instantMessages and unreadMessages):
UPDATE smf_members SET instantMessages = 0, unreadMessages = 0

smartdeviceresource

Quote from: alex30 on February 12, 2010, 10:55:12 AM
You actually can and that's what I was doing to spot lots spammers.
why not just set a minimum posts before PM (most spammers won't stick around for enough posts to do it and those do can be caught before they do because of their obvious posting
after some thought, i've learned to be humble and leave the answering to the experts, until i too am an expert.  sorry to anyone who I've confused, with my answers

JimM

Is this issue solved or do you still require assistance?
Jim "JimM" Moore
Former Support Specialist

Advertisement: