[PHP & MySQL] posting old data [FIXED]

Joined
Jun 8, 2007
Messages
1,961
Reaction score
475
Well this has got to be the weirdest thing I've ever seen..

I logged on as a guest on my project profile, just to test some things. I went to update my profile, and it posted the data to the database. I went to my profile, and it's still displaying the old data. I refreshed, signed out and back in again, checked the database to make sure it changed, went back to the update page to make sure it changed. Everything is changed, except the profile. It still has all the old data, that doesn't even exist anymore. How can it get data from a database and display it if it's not there? I checked in firefox and IE.. Both say the same thing.

On my account, everything works fine. I update, goto profile, it changes to what I put.

The problem is only in the guest account. (Or at least not mine or my grandma's)

How could this even happen? lol

There are no code errors reported.


EDIT:
This is just getting even more peculiar..

I just went into the guest account and changed the style of the page to brown. It updated that and put it on the profile.

The weird part of that is the data for the style change is in the profile table. (the same table as everything that is displaying old)

So it's getting the current style from the database, but everything else is old.

This also gives me a clue to where the problem is.

The form to change the style is separate from the update form.

The problem must be in the update form, located in includes/update.submit.php

But wait.. If the problem is there, then how come the data in the SQL database is still changing?
So that can't be the problem.. Right?

It can't be in profile.data.php (which loads the profile data), because all of the other profiles work perfectly, and the style loads fine from that page... Everything is so wacky!!

EDIT 2:
Maybe it's a client-side thing for me, try going to the guest's profile or try logging in as the guest.
Username: guest
Password: secret

I deleted my cookies, temporary pages, and form data.. Same result... So it's probably not just client side for me... I don't think it's possible to be actually..

EDIT 3:
Okay it was server side, and I'm a stupid or PhpMyAdmin updated slow.. (I'm probably just stupid). I checked the database like 10 times the night of the problem, didn't see 2 guest accounts. I logged onto my phpMyAdmin today, and there were 2 guest accounts. Makes sense now...
 
Last edited:
Re: [PHP & MySQL] posting old data?? wha?

i think maybe you have 2 different guest acc. that are the same thing. im not sure. haha.
 
Re: [PHP & MySQL] posting old data?? wha?

i think maybe you have 2 different guest acc. that are the same thing. im not sure. haha.

Well nope.. I said I checked the profile database, I think.. but thanks anyway.. I don't think this will get solved.. There's absolutly no logic to why this is happening :/ That's actually the first thing I checked so good guess lol..
 
Re: [PHP & MySQL] posting old data?? wha?

It's server side and you are doing something wrong with the variables or the query. Everything seems to be on their 'NULL' value, the default value.

Try to echo the data from the query directly and see if it's different from what gets displayed.

Also, you obviously haven't cleaned up this code, have you? :P
 
Re: [PHP & MySQL] posting old data?? wha?

Lol caught me.. I did do some clean-up, but it's only half-way done. Mostly I just sepperated every large script such as the two above. Before they were entities within the update.php page. Now they are in "includes/update.filename.php"

Well, the problem was my first instinct.. I appologize andrew, you were absolutly right. There were 2 guest profiles. I had to have looked 10 times for 2 guest profiles last night, but I didn't see the first one for some reason..

Today, when I went into the profiles table and ordered by name, I found a few names were creating new profiles for themselves after the date of the "includes" update.

Apparently, in the process of deleting useless code, I took out a very important entity that seemed useless to me. There was a bit of code in the create page that looked for your userID inside the profile table. If it found your userID there, you surely had a profile already, there was surely a problem why this script is being seen, and do not create profile.

Since I already got the data for profileID earlier in the code, I took out this script since I thought it was useless. Apparently, I put it there for a reason.. lol.. For now I put a script that does the same thing as before.

I also set userID inside table `profile` to Unique.


Problem Solved. (..?)
 
Last edited:
Back