1
JMorris
MySQL: Error number: 1052
  • 2005/8/9 11:11

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Using MySQL Debug, I get the following errors on every Front-Side page of my site:

SELECT FROM *****_users u, *****_user_profile p WHERE u.uid p.profileid AND (level '0'ORDER BY user_regdate DESC LIMIT 05
Error number
1052
Error message
Column'user_regdate' in order clause is ambiguous
0.000338)
SELECT FROM *****_users u, *****_user_profile p WHERE u.uid p.profileid AND (level '0'ORDER BY user_regdate DESC LIMIT 05
Error number
1052
Error message
Column'user_regdate' in order clause is ambiguous
0.00014)


XOOPS Version: 2.2.1
MySQL Version: 4.0.24-standard
PHP Version: 4.3.11

Could someone explain to me what these errors are and how to get rid of them?

Thanks,

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

2
Mithrandir
Re: MySQL: Error number: 1052

There is a user_regdate field in both the users table and the user_profile table, so MySQL don't know which one to order by.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

3
JMorris
Re: MySQL: Error number: 1052
  • 2005/8/9 11:18

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Quote:
by Mithrandir on 2005/8/9 7:13:03

There is a user_regdate field in both the users table and the user_profile table, so MySQL don't know which one to order by.


Should I delete one of the fields?

I'm not normally keen on deleting MySQL fields, but obviously something didn't go right during the upgrade.

Thanks Mithrandir. BTW... Welcome Back!

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

4
Dave_L
Re: MySQL: Error number: 1052
  • 2005/8/9 11:57

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


In 2.2.x, user_regdate should only be in the user_profile table. The update procedure should have copied its value from the users table, and then dropped the column from the users table.

You might examine the columns in both the users and user_profile tables, to see if the right columns are there, and that the user_profile column values look right.

If they look ok, drop the column users.user_regdate (or rename it to something like xxxxuser_regdate). I suggest backing up the database first.

5
JMorris
Re: MySQL: Error number: 1052
  • 2005/8/10 1:45

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Yup, just as you described it. I verified that the data was the same in both fields. Backed up my DB and dropped the field from *****_users. Not only did it stop the MySQL debug messages, but my New Members block now works.

I'm going through my entire site now with MySQL debug on seeing if I can find anymore similar problems that might be causing other bugs I've run into.

Thanks a million Dave_L!

Best Regards,

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

Login

Who's Online

551 user(s) are online (59 user(s) are browsing Support Forums)


Members: 0


Guests: 551


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Sep 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits