Notifications
Clear all

[Solved] Reviews are on the site, but missing in the database?

11 Posts
3 Users
0 Likes
2,961 Views
(@blayde)
Posts: 41
Eminent Member
Topic starter
 

URL to your eFiction: (Undisclosed because it is completely locked from non-members, and therefore, can't be inspected)
Version of eFiction: 3.3.1
Have you bridged eFiction, if so with what?: No.
Version of PHP: 3.4.11.1 (I think)
Version of MySQL: 5.5.23 (I think)
Have you searched for your problem: Yes
If so, what terms did you try: Database missing reviews, Reviews missing, Database losing reviews
State the nature of your problem: I'm finally preparing to update from 3.3.1 to 3.5.3, but came across an oddity. The database is missing reviews. In other words, certain reviews that can clearly be seen on the site are not in the DB. Therefore, if I update, reviews will go missing.
Do you have a test account for us? No.

I'd basically like to know if anyone has encountered this issue, and if they did, how did they fix it?
Or is this something that only my server can solve?

It poses a problem, not only for the upgrade, but if anything ever happens and I need to install a backup,
it wouldn't be a full one since data is missing.

Thanks.

 
Posted : 09/03/2013 4:21 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

I've never heard of a case like this and it's theoretically not possible. If it's happening, then something truly odd is going on with your database. The first thing that came to my mind is maybe the site is looking at a different database than you think it should be, but in that case it would be more than just reviews that weren't there, it could be the case for all kinds of data. (ie anything more recent like stories, news posts, etc.)

How did you determine that the reviews weren't in the database?

 
Posted : 09/03/2013 5:05 pm
(@blayde)
Posts: 41
Eminent Member
Topic starter
 

Thanks for the reply πŸ™‚

I determined it when someone asked me about the number
of reviews she left in the last year. I went to the database
and did a username search in the reviews table. It showed
her last review as being in April 2012, when, in fact, she
left a review in Jan. 2013. I actually saw it on the site, but
not in the DB.

That's when I looked at the review count at the site and
compared it with the amount in the DB. There was a
difference of 372 reviews. I used the archive maint to
recalculate the reviews several times to no avail.

So, oddly enough, 372 reviews are missing from the DB, or
something...

EDIT: I also noticed that my site is showing 114 stories when
there should be 123, and the DB shows 120 stories.

It seems like all of my counts are off for some reason...

 
Posted : 09/03/2013 5:30 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Did you try doing the search by uid instead of username? Just a thought to be extra sure. Also you can get the review id from the review and search for that in the database. Go to your site and find one of the reviews that you can't find in the DB and hover the "edit" or "delete" admin links. The URL hint that shows for it will have the reviewid at the end.

Other things to check: the database name in config.php matches the name of the database you're looking at. Check that there aren't similar issues with stories / chapters and so on.

Aside from user error in searching (sorry, you seem thorough so I doubt that's it!) or the mismatch with databases, I'm not sure what it would be. Some kind of weird caching on the server? You'd want to talk to your host, probably.

 
Posted : 09/03/2013 8:56 pm
(@blayde)
Posts: 41
Eminent Member
Topic starter
 

Thank you so much for the suggestions. They really helped! ^^

I'm definitely using the correct DB (but I double-checked to be sure).

I checked the uid and the review ID and I found the missing reviews from that user. o/
So, I'm going to assume that I will find them all that way.

One of the things I didn't factor in is that my site used to be open to the public without anyone needing a membership. Now, it's the opposite, so when I checked her reviews by name, only the ones from before the enforcement of membership came up. However, when I check by uid, only the ones after she became a member come up. Does any of that sound normal to you?

Also, there are 2 other issues I'd like to ask about.

The first would be, is there any way to ensure that all of an author's stories are in the database?

I ask because today when I checked my archive, I, myself, had 85 stories listed. But after deleting 6 stories today (that belonged to other people), my own story count went down to 81. I don't think anything is missing from my library, but that was weird.

Removing those stories also made some reviews disappear in the DB (Which is expected), but the number of reviews on my site didn't change, not even after recalculating reviews through archive maint. (This has been going on for ages).

I've deleted several stories over time, but my review counts at my site never changed. However, they did on the DB.

I know I can adjust the number of reviews on my site through the DB, but I don't want to do that without knowing if the DB count is absolutely correct. Any thoughts?

Thanks again for taking the time to help me. I really appreciate it!

 
Posted : 09/03/2013 10:54 pm
(@itanshi)
Posts: 381
Reputable Member
 

myisam woo, i blame myisam

It does not have foreign keys, so it does not do cascade changes.

I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 09/03/2013 11:58 pm
(@blayde)
Posts: 41
Eminent Member
Topic starter
 

I really don't know what that function does, but I totally believe you!
My archive is just haywire right now...

 
Posted : 10/03/2013 3:45 am
(@itanshi)
Posts: 381
Reputable Member
 

It's a database engine. In this case it's a rather old and unsused one. Innodb is the standard for mysql, today. PHP 5.5 is in development. 5.2 which this script is based on is a dead unsupported version. This script also uses MD5 salted hashing for encryption. Its a dead unused method and is nothing at all secure. With access to the cookie (over the air via a non https connection) or your database itself, no password is safe.

I am rebuilding efiction! Join us on irc! #efiction at www.mibbit.com Instructions for irc πŸ˜€ Alpha released!

 
Posted : 10/03/2013 4:33 am
(@blayde)
Posts: 41
Eminent Member
Topic starter
 

Whoa. I mean, I guess that's bound to happen since efic4 isn't out yet,
(Through this forum) and coding does become deprecated over time,
but to know that we're all using something that unsecured certainly gives
me a scare.

Thanks for the knowledge; it's definitely appreciated.

 
Posted : 10/03/2013 10:27 am
(@lyndsie)
Posts: 1263
Member Moderator
 

I can't remember how anonymous reviews work since I haven't ever allowed them that I can recall, but if there is the option to put in a name then that could be why you are finding them under the username. If there was a variation between the username associated with her account and what she was typing in before I guess that would make sense.

To me it doesn't sound like you are having any problems with your database. The stuff that shows on the site *has* to be in the database. That's the only way for it to appear. (Barring something *highly* unlikely, strange, and super buggy with your server - meaning something I haven't seen in 8 years of doing this kind of stuff.) If you're seeing a mismatch between the counts and what's in the DB then something's wrong with counts. If you're still concerned, take a look at your stories. Sort them alphabetically and do the same in the DB with your stories (you can do SELECT * WHERE uid = xxxx, xxx being your uid and then sort them on the story name column) and go down the line. You should see that none are missing.

Potentially deleting stories updated the counts site-wide and that's why you "lost" stories in your count. They really weren't there and no data was actually deleted.

 
Posted : 10/03/2013 3:45 pm
(@blayde)
Posts: 41
Eminent Member
Topic starter
 

Huge relief to know that I'm not randomly losing stories (or causing others to lose theirs).
Thank you so much for the sound explanations and advice. You've really helped me bunches!
I'll definitely do a quick run-through my DB/Site and make the adjustments needed. I kinda
wish my archive maintenance actually worked, but that's a small thing, overall.

I shall mark this solved. Thank you!  πŸ˜€

 
Posted : 10/03/2013 4:30 pm
Share: