1
amok200
SQL error revealed by debug, please advise
  • 2004/3/10 20:20

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


Hi,

Debug reveals the following error:

SELECT * FROM xoops_session WHERE login_type='1' AND uid>0
Error number: 1054
Error message: Unknown column 'uid' in 'where clause'

The preceding two lines are:

SELECT member_id as uid FROM xoops_session WHERE login_type='1' AND member_id=1
SELECT member_id as uid FROM xoops_session WHERE login_type='1' AND member_id=0

XOOPs doesn't seem any the worse for wear, but what is going on here, why isn't it picking up that member_id is being cast as uid.. Can I fix this, or can the query be rewritten to use member_id instead ?

I get this error on every page when I am logged in, as it is looking at the current session I guess.

Thanks,

Amok

2
hervet
Re: SQL error revealed by debug, please advise
  • 2004/3/10 20:25

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


hi,

may be you should reinstall your site

3
amok200
Re: SQL error revealed by debug, please advise
  • 2004/3/10 20:31

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


Hi,

Thanks. Is there a less drastic course of action ?

Amok

4
tywick
Re: SQL error revealed by debug, please advise
  • 2004/3/10 20:58

  • tywick

  • Just popping in

  • Posts: 12

  • Since: 2002/9/17


Quote:
Debug reveals the following error:

SELECT * FROM xoops_session WHERE login_type='1' AND uid>0
Error number: 1054
Error message: Unknown column 'uid' in 'where clause'


change the SQL statement from this

SELECT FROM xoops_session WHERE login_type='1' AND uid>0


to this

SELECT FROM xoops_session WHERE login_type='1' AND member_id>0


see if that helps.

I'm not exactly sure what file the code is from. You may need to alter code that is trying to grab info from that statement.




5
amok200
Re: SQL error revealed by debug, please advise
  • 2004/3/10 21:19

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


Thanks, I guess that would do the trick, I ran the query in phpmyadmin and it executes without error.

However I don't know where to put it ! Anyone know where this query comes from ?

Amok

6
amok200
Re: SQL error revealed by debug, please advise
  • 2004/3/11 0:20

  • amok200

  • Just popping in

  • Posts: 68

  • Since: 2004/2/23


I discovered that the session table usually has this structure:

sess_id varchar(32) NOT NULL default '',
sess_updated int(10) unsigned NOT NULL default '0', sess_ip varchar(15) NOT NULL default '',
sess_data text NOT NULL

However mine has this structure:

sess_id varchar(32) NOT NULL default '',
sess_updated int(10) unsigned NOT NULL default '0',
sess_ip varchar(15) NOT NULL default '',
sess_data text NOT NULL,
member_name varchar(64) NOT NULL default '',
member_id mediumint(8) NOT NULL default '0',
browser varchar(64) NOT NULL default '',
login_type tinyint(1) NOT NULL default '0',
location varchar(40) NOT NULL default '',
member_group smallint(3) NOT NULL default '0',
in_forum smallint(5) NOT NULL default '0',
in_topic int(10) NOT NULL default '0',

Is this normal ? Does some process within the XOOPs core add these columns ?

Or were they added by another module ? I am running IPB v1.4a perhaps that added them.

Can anyone shed some light on this table and the associated error ? Or atleast point me towards the code that is calling this table so I can amend it given my seemingly non-standard table structure.

Thanks !

Amok


Login

Who's Online

211 user(s) are online (140 user(s) are browsing Support Forums)


Members: 0


Guests: 211


more...

Donat-O-Meter

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

Latest GitHub Commits